84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
var requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
这段代码在 MX 2 原生浏览器上面报错。
欢迎选择我的课程,让我们一起见证您的进步~~
实测,目前(2014-11-19) mx2 是没有 requestAnimationFrame 的。 降级处理:
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || function fakeRequestAnimationFrame(cb, t) { setTimeout(cb, t || 1) }
补充一下,rAF方法要Android4.4才支持的,具体刻查看: http://caniuse.com/#search=requestAnimationFrame
4.4对国产手机来说算是比较新的了,MIUI你估计也是测试了MIUI6吧,MIUI5都还在4.1呢。
安卓手机的浏览器都不支持这个好像。用setTimeout替代或者做降级处理把2
实测,目前(2014-11-19) mx2 是没有 requestAnimationFrame 的。
降级处理:
补充一下,rAF方法要Android4.4才支持的,具体刻查看: http://caniuse.com/#search=requestAnimationFrame
4.4对国产手机来说算是比较新的了,MIUI你估计也是测试了MIUI6吧,MIUI5都还在4.1呢。
安卓手机的浏览器都不支持这个好像。用setTimeout替代或者做降级处理把2