Skip to content Skip to sidebar Skip to footer

Jquery - Toggleclass/addclass/removeclass

I have the following codes to create a top sliding admin panel, that will appear from the very top of the page. This sliding panel will be activated but clicking on the button '#tp

Solution 1:

This is the jQuery I use to add and remove classes

To add:

$("#some-id").toggleClass('class-name', 'add');

To Remove:

$("#some-id").toggleClass('class-name', 'remove');

In this fiddle toggleClass is used to trigger css animations

Post a Comment for "Jquery - Toggleclass/addclass/removeclass"