1
I have a toggle effect that opens and closes a div, and in this effect, I put to add a class and remove. It adds the class, but is not removing it. Why?
Jquery
$j('.filters__filter.tamanho').click(function(){ $j('.filters__filter.tamanho .ul--0').slideToggle(150); //remove class active $j('.filters__filter.tamanho').removeClass('active'); //adiciona class active ao item clicado $j('.filters__filter.tamanho').addClass('active'); });
If I click again, the active class
You are ordering him to remove the class and then you add it again?
– wDrik
Yeah, it got confused kk, I’ve tried so hard to do this here, I’m not getting it. How do I make it add when it’s selected, and when it’s clicked again or another div is selected, it removes the class? Is there any way or in the next selected div code, I will have to have that div removed? Thanks!
– Lucas de Carvalho