我是新來的jQuery。我使用Animate.css,只是想在動畫中加入延遲,所以我嘗試這樣做:簡單的動畫延遲不起作用
$('#fadeInRight').delay(20000).addClass('animated fadeInRight');
這是爲什麼不工作?
我是新來的jQuery。我使用Animate.css,只是想在動畫中加入延遲,所以我嘗試這樣做:簡單的動畫延遲不起作用
$('#fadeInRight').delay(20000).addClass('animated fadeInRight');
這是爲什麼不工作?
setTimeout(function(){$('#fadeInRight').addClass('animated fadeInRight')},20000);
我知道這個工作,但我從來沒有理解爲什麼jQuery的「.delay」不。 –
https://api.jquery.com/delay/ –
的github page狀態的另一種方式來添加延遲,沒有jQuery的需要:
#yourElement {
-vendor-animation-duration: 3s;
-vendor-animation-delay: 2s;
-vendor-animation-iteration-count: infinite;
}
注:一定要更換包含應用程序的CSS中的「供應商」可供應商前綴(webkit,moz等)
請注意,此方法僅在IE10及更高版本中受支持。 –
你能提供你的代碼樣本嗎?也許一個小提琴showig問題? – badAdviceGuy
你是否嘗試過其他方式? ''('#fadeInRight')。addClass('animated fadeInRight')。delay(20000);' –
當然你發現的一個問題建議使用setTimeout來延遲addClass –