jantimon
jantimon

Reputation: 38140

jQuery plugin to animate colors from one class to another

There are a lot of jQuery color plugins. However I couldn't find the one to animate between css class declarations.

For example doing a smooth animation from .class1 to .class2:

.class1 { background-color: #000000 }
.class2 { background-color: #000088 }

Is this possible at all?

Upvotes: 1

Views: 1782

Answers (2)

Russ Cam
Russ Cam

Reputation: 125488

The jQuery animate() command already allows you to animate colour transitions.

Here's a more striking demo

EDIT:

To get the same effect with CSS classes, there is

Upvotes: 6

Elzo Valugi
Elzo Valugi

Reputation: 27866

I think a plugin can be done that will read all computed properties of class A, match them with the properties of class B, animate what it can be animated, and ignore the rest of properties.

I have not seen no one out there but it can be done.

Upvotes: 2

Related Questions