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

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -