Reputation: 17045
In a jQuery script I'm applying a CSS style to a html table row to highlight it on a row link click:
$(this).closest('tr').css("background-color", "silver");
How can this changing color effect be appied softly with an effect like fading in a hidden object?
Upvotes: 1
Views: 199
Reputation: 1898
Please note: You need to use JQuery UI as well.
$(this).closest('tr').animate({ backgroundColor: "silver" }, 1000);
Replace 1000 with how long you want it to take to change to silver.
Upvotes: 1
Reputation: 34632
Color can be animated using jQuery. The easiest way to accomplish this is to use the Color Plugin. Also, if you are already using jQuery UI, it also supports this functionality.
Upvotes: 3