Search code examples
jquerytoggleclass

Funny .toggleClass()


I'm using some pretty simple .toggleClass() with animation of 1 second.Everything works fine,except the animation. I'm finding this really funny.

Look at my fiddle!

$(function(){

 $('#main_button').click(function(){
 $('#one, #two, #three, #four').toggleClass("width", 1000);
 return false;
});
});

Solution

  • JQuery UI extends toggleClass to allow for animations, but the default JQuery .toogleClass() won't animate. You need to include JQuery UI in your fiddle.