1 | var global = typeof window === 'undefined' ? this : window
|
2 |
|
3 | var _raf =
|
4 | global.requestAnimationFrame ||
|
5 | global.webkitRequestAnimationFrame ||
|
6 | global.mozRequestAnimationFrame ||
|
7 | global.msRequestAnimationFrame ||
|
8 | global.oRequestAnimationFrame ||
|
9 | (global.setImmediate ? function(fn, el) {
|
10 | setImmediate(fn)
|
11 | } :
|
12 | function(fn, el) {
|
13 | setTimeout(fn, 0)
|
14 | })
|
15 |
|
16 | module.exports = _raf
|