MCPcopy Create free account
hub / github.com/codrops/RainEffect / _checkTimeout

Function _checkTimeout

demo/js/index.js:10035–10040  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10033
10034 //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.
10035 var _checkTimeout = function() {
10036 if (_tickerActive && _getTime() - _lastUpdate > 2000) {
10037 _ticker.wake();
10038 }
10039 setTimeout(_checkTimeout, 2000);
10040 };
10041 _checkTimeout();
10042
10043

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected