setTimeout() - what's going on in IE6?
IE6 has got me again! I can write
slideSuccess.show();
and all will be fine. When I replace that very line with
开发者_StackOverflow社区setTimeout(function() { slideSuccess.show(); }, 1000);
then, after 1 sec, my slide shows up garbled.
(slideSuccess is a jQuery object if that matters.)
Does anyone have any ideas what is going on here?
Thanks.
Instead of using a setTimeout()
, which won't queue the show until 1 second from now, put the timeout in the queue using .delay()
, like this:
slideSuccess.delay(1000).show();
Otherwise you're not showing then animating, you're animating and running a .show()
during it, whatever animation is executing in the queue...instead you can delay the queue from starting overall, with .delay()
.
精彩评论