我尝试在改变窗口位置时使用丰富的闪光效果,但存在一个小问题,我无法解决。setTimeout不适用于window.location?
看剧本请
$(document).ready(function(){
$('a.flash').click(function(e) {
e.preventDefault();
$('body').fadeOut(1500);
setTimeout("", 1500);
window.location=this.href;
});
});
window.location=this.href
必须1500毫秒后进行的,但它不会发生。你可以解释为什么吗? ? 奇怪的是,当我尝试写alert("something");
而不是window.location=this.href
,它工作正常。你能解释为什么吗?
感谢
为什么它在我写alert()时工作?在这种情况下,它会“睡”1500毫秒,并在警报后。为什么? – Simon 2010-06-13 17:51:37