jQuerybeast jQuerybeast - 1 year ago 111
jQuery Question

Can you make toggleClass animation without jQuery UI?

Can I make this: http://jqueryui.com/demos/switchClass/default.html without jQuery UI?

Basically I have a simple site which the body has a class named:


has background color: #ccc and I want to toggle the
of which backgroundcolor is #999 with the fade effect.

Is it possible with only jQuery?


Answer Source

Unfortunately, to fade between background colors, you need JQuery UI or something similar. You might try this color animation plugin, or alternatively, use CSS3 transitions and simply use jQuery to toggle animated classes.

Here is an example of CSS3 color animation with a JavaScript/JQuery trigger: http://jsfiddle.net/6nRj2/

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download