当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - jQuery applying CSS style with an effect like FadeIn() one

问题描述:

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?

网友答案:

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.

网友答案:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: