有没有好的方法来做颜色自行车在javascript? [英] Is there a good way to do color cycling in javascript?
问题描述
这里是我想做的:在HTML页面中有一行文本。我想让这段文字从一个给定的颜色开始,循环播放光谱,等待一两秒钟,然后重复。
Here's what I'd like to do: I've got a line of text in an HTML page. I'd like to have that piece of text start at a given color, cycle though the spectrum, wait a second or two, and then repeat.
我想如果可能的话,在javascript中这样做(类似flash的东西不是完全没有问题,但会是这个项目的一些主要范围)。
I'd like to do this in javascript if possible (something like flash isn't totally out of the question, but would be some major scope creep of this project.)
JS知道这是可能的,但这是关于它。任何人都可以指向正确的方向?
I know enough JS to know this is possible, but that's about it. Can anyone point me in the right direction?
是的,这是一个真正的客户端请求。我很高兴他们没有也要求眨眼标签。 ;)
And yes, this is a real client request. I'm just glad they didn't also ask for the blink tag. ;)
推荐答案
浏览一些淡入淡出示例后,我们最终使用jQuery的.animate a href =http://plugins.jquery.com/project/color =nofollow noreferrer>此颜色动画插件。工作壮观。
After browsing some of the "fading" examples, we ended up going with jQuery's .animate() function and this color animation plugin. Works spectacularly.
这篇关于有没有好的方法来做颜色自行车在javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!