爲什麼這是行不通的延遲不工作
$('#upload-title').css({ background: '#ffffff' }).delay(800).css({ background: '#00FF72' });
32,我想#上傳的標題。白色爲0.5秒。感謝您的幫助
爲什麼這是行不通的延遲不工作
$('#upload-title').css({ background: '#ffffff' }).delay(800).css({ background: '#00FF72' });
32,我想#上傳的標題。白色爲0.5秒。感謝您的幫助
你需要使用超時,延遲是指使用帶有動畫:
可以使用queue
方法css
調用添加到隊列
$('#upload-title').css({
background : '#eeeeff'
});
setTimeout(function() {
$('#upload-title').css({
background : '#00FF72'
});
}, 800);
delay
方法延遲了效果隊列中的東西,而css
不是效果方法。
$('#upload-title').css({ background: '#ffffff' }).delay(500).queue(function(){
$(this).css({ background: '#00FF72' });
});
不錯的解決方案.. – Blowsie
偉大的作品! - '$('newPost').css(「background-color」,「#D6F5D6」)。fadeIn('slow')。delay(1500).queue(function(){ $(this).css (「background-color」,「#F1F1F1」); $(this).removeClass('newCommentItem'); });' –
$(function() {
setTimeout(
function() {
$('#upload-title').css({
background: '#00FF72'
});
}, 500
);
})
我個人比較喜歡古法的鏈式方法。 – Blowsie
你不需要*使用超時。 – Guffa
我更喜歡隊列方法,不知道那個。 – Jasuten