开发者

Unable to addclass to an active sub li in Jquery accordion

I am using Jquery Accordion with a UL contained within each section and I cant figure out how to add a class to indicate the active link.

I have searched my head-off but the only thing I can find doesnt work with the Acco开发者_开发知识库rdion:

$(document).ready(function(){
  var path = location.pathname.substring(1);
  if ( path )
    $('#accordion1 a[href$="' + path + '"]').attr('class', 'activelink');
});

Please help, as I am premeturely going bald!


Why not use addClass?

$('#accordion1 a[href$="' + path + '"]').addClass('activelink');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜