欢迎各位兄弟 发布技术文章
这里的技术是共享的
效果如图
var speed = 22; //摇一摇程序,建议值在20-25之间; var x = y = z = lastX = lastY = lastZ = 0; //默认值 window.addEventListener('devicemotion', function() { var acceleration = event.accelerationIncludingGravity; x = acceleration.x; y = acceleration.y; if (Math.abs(x - lastX) > speed || Math.abs(y - lastY) > speed) { //window.location.href = 'http://pkt.zoosnet.net/LR/Chatpre
isNaN 返回一个 Boolean 值,指明提供的值是否是保留值 NaN (不是数字)。
call语法:call(thisObj,Object)
apply语法:apply(thisObj,[argArray])