$(function(){ $('#circle').click(function(){ $('.circle').switchClass('circle', 'square', 'slow'); $('.square').switchClass('square', 'circle', 'slow'); return: false }); });
In this example, when I click #circle Div, I remove the .circle class from all objects and replace it with the .square class. If the .circle class should not be removed, the .square class will be removed and replaced by the .circle class. This is a switching effect.
If you do not want the switch to simply delete the top or bottom.
Jacob9706
source share