SetInterval pauses on iphone / ipad (mobile Safari) while scrolling

I use the setInterval function on the website and it works fine in IE, Chrome, Firefox and Safari. When I try to do this on ipad / iphone (safari mobile), I get a problem: if I scroll the screen, the setInterval function pauses and it only resumes when I stop scrolling!

Is there a way to prevent a function from pausing? Thanks

+7
source share
3 answers

I am afraid that there is no way to prevent this behavior. There are many topics devoted to this problem (more or less or less), interesting is especially interesting here. Its summary is simple:

iOS elastic scroll cannot be tracked. There is no event listener + both timeouts / intervals are not executed while scrolling. And since there is no requestAnimationFrame in iOS5, this seems impossible to solve.

+6
source

iOS6 Safari suffers from an error that kills timers created while scrolling a page.

There is a problem with this problem provided by kTmnh by recreating timers after scrolling is complete

https://gist.github.com/3798925 .

+1
source

Check @Pattishall answer on this topic iOS 6 js event function is not called if it has setTimeout

0
source

All Articles