Skip to content

Instantly share code, notes, and snippets.

@jpattishall
jpattishall / TouchTimerWorkaround.js
Last active Jan 26, 2018
setTimeout workaround for iPad and iOS6
View TouchTimerWorkaround.js
/**
Workaround for iOS 6 setTimeout bug using requestAnimationFrame to simulate timers during Touch/Gesture-based events
Author: Jack Pattishall (jpattishall@gmail.com)
This code is free to use anywhere (MIT, etc.)
Note: UIWebView does not support requestAnimationFrames. If your timer is failing during a scroll event,
take a look at https://gist.github.com/ronkorving/3755461 for a potential workaround.
Usage: Pass TRUE as the final argument for setTimeout or setInterval.
You can’t perform that action at this time.