Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript animation halted in ios safari webkit browser when finger is on the screen without lifting

i have a webview, that is being show in an app there is an animation on the page, a digital timer, where i am showing the images of each digit like so 00:39, 29:39, etc

it is being animated use setInterval in javascript within the page problem is that when i put my finger on the screen, i.e. a touch without lifting my finger the browser halts, meaning the animation no longer animates, it stops at the place when my finger touch the screen , and it will continue animate after i lift my finger

how can i fix this? i heard that i can use prevent default method, but wouldn't that ignore all my events on the page?

basicaly besides the timer in my webpage, i also have some stuff that user can interact with , so it is looking for the click event etc.

so i definitely want to keep that as well please help

this happens on ios device...if i run in desktop brower, everything seems ok..not halting being observed

like image 599
user1118019 Avatar asked Apr 27 '12 18:04

user1118019


1 Answers

Just for anyone that comes across this later: Animations always halt in web browsers when scrolling, which is what your web view is anticipating by the finger touch. This will happen on desktop browsers as well.

like image 107
JoeCortopassi Avatar answered Oct 14 '22 00:10

JoeCortopassi