admin管理员组文章数量:1341395
I use the setInterval function in a website, and it works fine in IE, Chrome, Firefox and Safari. When i try it on ipad/iphone (safari mobile) i get problem: if i scroll the screen, the setInterval function pauses and it resumes only when i stop scrolling!
is there a way to prevent the function from pausing? Thanks
I use the setInterval function in a website, and it works fine in IE, Chrome, Firefox and Safari. When i try it on ipad/iphone (safari mobile) i get problem: if i scroll the screen, the setInterval function pauses and it resumes only when i stop scrolling!
is there a way to prevent the function from pausing? Thanks
Share asked Jun 24, 2012 at 13:17 user1478076user1478076 731 gold badge1 silver badge3 bronze badges3 Answers
Reset to default 6I'm afraid no, there's no way to prevent such behaviour. There's a plenty of topics here in SO about this problem (more-o-less related), here's a particularly interesting one. Its summary is simple:
iOS elastic scroll can't be tracked. There's no event listener for it + both timeout / interval doesn't execute during scroll. And because there's no requestAnimationFrame in iOS5, this seems impossible to solve.
iOS6 Safari suffers from a bug that kills timers that are created while a page is scrolling.
There is a fix to this problem provided by kTmnh by recreating timers after scrolling finishes
https://gist.github./3798925.
Check @Pattishall answer on this subject iOS 6 js events function not called if has setTimeout in it
本文标签: javascriptsetInterval pauses in iphoneipad (mobile Safari) during scrollingStack Overflow
版权声明:本文标题:javascript - setInterval pauses in iphoneipad (mobile Safari) during scrolling - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743674072a2520017.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论