[英]Why $(window).load() doesn't work in IE10
I have the following script: 我有以下脚本:
function AnimateRotate(d){
var elem = $("#imgLogoWM");
//elem.fadeIn(2000);
$(elem).hide();
$(elem).each(function(i) {
if (this.complete) {
$(this).fadeIn(1500);
} else {
$(this).load(function() {
$(this).fadeIn(2000);
});
}
});
/*$({deg: -60}).animate({deg: d}, {
duration: 2000,
step: function(now){
elem.css({
transform: "rotate(" + now + "deg)"
});
elem.fadeIn(2000);
}
});*/
}
$(window).load(function (){
timer = setTimeout('auto_reload()', 1800000);
AnimateRotate(0);
});
var timer = null;
function auto_reload() {
window.location = 'index.htm';
}
It works great in IE < 10 and FF and Chrome and Avant and Opera. 它在IE <10和FF以及Chrome和Avant和Opera中非常有效。 The AnimateRotate(0);
AnimateRotate(0);
does not work in IE10. 在IE10中不起作用。 Any idea how to go around it so it works in IE10 as well? 任何想法如何解决它,使其也可以在IE10中使用吗?
To sum up: use document-ready rather than onload: api.jquery.com/ready 总结:使用文档就绪而不是onload:api.jquery.com/ready
$(document).ready( ...function stuff ...) or with less code
$( function(){ ...function stuff ...});
maybe you like to hand over the variable name "auto_reload" 也许您想交出变量名“ auto_reload”
setTimeout(auto_reload, 1800000)
to be executed later on instead of the immediately executed function "auto_reload()" to the timeout method. 而不是立即执行超时功能的立即执行函数“ auto_reload()”。 Checkout, if IE does take care of this. 结帐,如果IE确实做到了这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.