Mat*_*xYo 2 javascript window requestanimationframe
代码
var x = {};
x.request = window.requestAnimationFrame;
function step(timestamp) {
console.log('sth');
}
x.request(step);
Run Code Online (Sandbox Code Playgroud)
它返回:
NS_ERROR_XPC_BAD_OP_ON_WN_PROTO:WrappedNative原型对象上的非法操作
它应该使x.request与window.requestAnimationFrame一样工作.我需要它,因为我想做类似的东西:
x.request = window.requestAnimationFrame
||
window.webkitRequestAnimationFrame
||
window.mozRequestAnimationFrame;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
71 次 |
| 最近记录: |