私はこれを持つ要素ハイライトしたい:.css()。animate()は機能しませんか?
$('input.step:last').css('background','#003').animate({'background':'#fff'},300);
をしかし、それは動作しません。
なぜですか?
私はこれを持つ要素ハイライトしたい:.css()。animate()は機能しませんか?
$('input.step:last').css('background','#003').animate({'background':'#fff'},300);
をしかし、それは動作しません。
なぜですか?
あなたの必要性JQuery.Color
プラグイン(jquery-ui
の一部)。次に、
$(document).ready(function(){
$('input.step:last')
.css({'backgroundColor':'#003'})
.animate({'backgroundColor':'#fff'},300);
})
色をアニメーション化するには、jQuery Animate Colorsプラグインを追加する必要があります。
http://www.bitstorm.org/jquery/color-animation/
次に、あなたが使用する必要があります。
$('input.step:last').css('background-color','#003')
.animate({'background-color':'#fff'},300);
マインドあなたは「背景色」プロパティではなく、「背景」1をアニメーション化すべき違いを。
私の悪い、これは正しい答えです –
デフォルトでは、jQuery can’t animate colorsです。 jQuery.color()
plugin, found here,を使ってその能力を発揮することができます。
jQueryUIを含みます。 – j08691