Posted By

phl on 04/19/13


Tagged

js jquery i18n


Versions (?)

language


 / Published in: JavaScript
 

  1. $(".lang-de").hide()
  2. $('a[href="#english"]').parent().addClass("active");
  3. $('a[href="#deutsch"]').click(function(){
  4. $.cookie("lang", "de");
  5. $('.language').removeClass("active");
  6. $('.lang-link-de').each(function(){$(this).parent().addClass("active")});
  7. $(".lang-de").show()
  8. $(".lang-en").hide()
  9. $('a[href="#english"]').show();
  10. $(this).hide();
  11. });
  12. $('a[href="#english"]').click(function(){
  13. $.cookie("lang", "en");
  14. $('.language').removeClass("active");
  15. $('.lang-link-en').each(function(){$(this).parent().addClass("active")});
  16. $(".lang-en").show()
  17. $(".lang-de").hide()
  18. $('a[href="#deutsch"]').show();
  19. $(this).hide();
  20. });
  21. if ($.cookie("lang") != null) {
  22. $(".lang-link-"+$.cookie("lang")).trigger('click');
  23. };

Report this snippet  

You need to login to post a comment.