Sha256: e47c7cbf36c8feda4b71d470c80bf9c9d7c1496159a6bd3777a4baee3c58b384
Contents?: true
Size: 682 Bytes
Versions: 19
Compression:
Stored size: 682 Bytes
Contents
lastTime = 0 vendors = ['webkit', 'moz'] for vendor in vendors when !window.requestAnimationFrame window.requestAnimationFrame = window["#{vendor}RequestAnimationFrame"] window.cancelAnimationFrame = window["#{vendor}CancelAnimationFrame"] || window["#{vendor}CancelRequestAnimationFrame"]; unless window.requestAnimationFrame window.requestAnimationFrame = (callback, element) -> currTime = Date.now() timeToCall = Math.max(0, 16 - (currTime - lastTime)) id = setTimeout -> callback(currTime + timeToCall) , timeToCall lastTime = currTime + timeToCall id unless window.cancelAnimationFrame window.cancelAnimationFrame = window.clearTimeout
Version data entries
19 entries across 19 versions & 1 rubygems