Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

July 13 2010

webspinnerinc
06:47

Answer by Gabriel for jQuery: set 'active' class in menu from secondary link

$('a[rel=panel]').click(function (e) {
  $('a[rel=panel]').parent('li').removeClass('current');
  // $(this).parent("li").addClass('current');
  $(".nav2 a[href='" + $(this).attr('href') + "']").parent('li').addClass('current');
});​

this worked fine over at:

http://jsfiddle.net/s2vxe/

let me know if you need more in this one.