jQuery淡入背景颜色 [英] jQuery fade in background colour

查看:158
本文介绍了jQuery淡入背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图淡入表格行的背景颜色,不能正确。

I'm trying to fade in the background colour of a table row, and can't get it right. The fade-in will happen when a button is clicked.

我尝试过类似的操作:

$("#row_2").fadeIn('slow').css('background', 'gold')

虽然这会将颜色应用到表格行,但不会淡入,而是立即应用。

And although this will apply the colour to the table row, it won't fade in, but apply it at once.

我相信这是一个简单的事情,但我找不到一个答案。

I'm sure this is a simple thing, but I can't find an answer to that. I've looked all over in this website, but still no luck for this specific thing.

提前感谢

推荐答案

纯jQuery没有动画颜色的功能。您必须使用 jQueryUI jQuery color plugin

The pure jQuery does not have functionality to animate colors. You have to use jQueryUI or jQuery color plugin.

然后使用 .animate()

这篇关于jQuery淡入背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆