ないあなたはどちらか欲しいものを確認してください、私はちょうど(似た何かをする方法の例を書いて、私は戻ってきませんよ、私の人生の15分を費やして、すべて同じではUIを使用していますカラーアニメーション用)。
var words = ['Lorem', 'Tatum'],
color = 'red',
elems = [],
T1 = setInterval(randomRed, 1000);
$('#yourelements').each(function() {
if ($(this).text() == words[0] || $(this).text() == words[1]) {
elems.push($(this));
}
});
//I cut this down from the example in the fiddle, elements could be filtered in the below function instead?
function randomRed() {
$(elems).each(function() {
var r1 = Math.random()*500,
r2 = Math.random()*1000;
$(this).delay(r1).animate({color: color}, r2, function() {
var r3 = Math.random()*500,
r4 = Math.random()*1000;
$(this).delay(r3).animate({color: 'black'}, r4);
});
});
}
ここで問題が何であるかは明らかではないfiddle!
です。 setTimeoutが機能しないのはなぜですか? – maxedison
色をネイティブにアニメーション化することはできません。https://github.com/jquery/jquery-color –