jquery delay altering css [英] jquery delay altering css
本文介绍了jquery delay altering css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图重置一些CSS,但点击后的延迟。由于某种原因,延迟似乎被忽略。任何想法?
I am trying to reset some css but with a delay after the click. For some reason the delay seems to be getting ignored. Any ideas?
$("#closeMe").live("click", function() {
$("#selectContainer").fadeOut( function() {
scrollerPos = 1
$(".scroller").delay(3000).css({"margin-left":"0px"});
$("#selectContainer img").delay(3000).css({"background-color":"#FFF"});
$("#selectContainer img:eq(0)").delay(3000).css({"background-color":"#000"});
});
});
推荐答案
我不相信 css
参与效果的东西,所以它不会知道队列。从 延迟
文档:
I don't believe css
participates in the effect stuff, so it won't be aware of the queue. From the delay
docs:
只有队列中的后续事件被延迟;例如,这不会延迟
.show()
或.hide()
的无参数形式使用效果队列。
Only subsequent events in a queue are delayed; for example this will not delay the no-arguments forms of
.show()
or.hide()
which do not use the effects queue.
很肯定 css
没问题;你可以这样做:
No problem, though; you can do this:
$("#closeMe").live("click", function() {
$("#selectContainer").fadeOut( function() {
scrollerPos = 1
setTimeout(function() {
$(".scroller").css({"margin-left":"0px"});
$("#selectContainer img")..css({"background-color":"#FFF"});
$("#selectContainer img:eq(0)").css({"background-color":"#000"});
}, 3000);
});
});
这篇关于jquery delay altering css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文