为什么这是行不通的延迟不工作
$('#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