[ACCEPTED]-jquery - how to add/remove class on slideToggle?-slide
Accepted answer
You can toggle the class using .toggleClass()
based on 2 if the element .is()
:visible
after the animation, like 1 this:
$('#btCategoriaA').click(function() {
$('#listaCategoriaA').slideToggle('slow', function() {
$('#btCategoriaA').toggleClass('selecionado', $(this).is(':visible'));
});
});
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.