[英]jquery slider stops working when page is refreshed in FireFox only
I have a slider that I have been using for a long time without problems, however, I have now discovered that in FireFox from I think version 25 onwards sometimes the slider runs properly on page load and other times it doesn't, if it works and I refresh the page with the refresh icon it may or not work, if I go into the address bar and press return it works. 我有一个使用了很长时间的滑块,没有问题,但是,现在我发现从FireFox开始,我认为从版本25开始,有时该滑块在页面加载时可以正常运行,而有时却不能正常运行(如果可以)如果我进入地址栏并按回车键,则可以使用刷新图标刷新页面,该图标可能有效,也可能不起作用。
It works fine on IE, Chrome, Safari and Opera, I have uploaded it to the site below if anyone can help; 它可以在IE,Chrome,Safari和Opera上正常运行,如果有人可以帮助,我已将其上传到下面的网站;
www.roadtotheweb.com www.roadtotheweb.com
Thanks 谢谢
I was having the same problem. 我遇到了同样的问题。 For me, the problem was fixed by commenting out that line of jQuery:
对我来说,此问题通过注释掉jQuery的行而得以解决:
context.drawImage(sour[0],newL,newT,newW,newH);
In other words, and I don't mean to patronize: 换句话说,我并不是要光顾:
// context.drawImage(sour[0],newL,newT,newW,newH);
Your site could potentially need that line of code, but at least give it a try and hope everything works. 您的站点可能需要该行代码,但至少可以尝试一下,希望一切正常。
I ended up encapsulating the offending code in a dummy setTimeout function which seems to have worked 我最终将有问题的代码封装在一个虚拟的setTimeout函数中,该函数似乎已经起作用了
setTimeout(function () {
if (hasCanvas) {
context.drawImage(sour[0],newL,newT,newW,newH);
if (sourbw.length>0) {
contextbw.drawImage(sourbw[0],newL,newT,newW,newH);
setTimeout(function() {
sour.parent().find('.canvas-now-bw').cssAnimate({'opacity':'0.0'},{duration:newitem.data('colortransition')*1000,queue:false});
},500);
}
}
}, 0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.