addclass - Jquery active class trouble -
i have example
$('li').click(function() { $(this).siblings().removeclass('active'); $(this).addclass('active'); }); all great need thing. need class removes when click li active class again.
so, replace line:
$(this).addclass('active'); with this:
$(this).toggleclass('active'); see: toggleclass
Comments
Post a Comment