Closed dongnanyanhai closed 8 years ago
教程中提供的Flappy Bird代码没有禁止web页面上下拉,在部分手机上会出现抖动。
可以通过下面的方法解决:
$(document).ready(function() { function stopScrolling(touchEvent) { touchEvent.preventDefault(); } document.addEventListener('touchstart', stopScrolling, false); document.addEventListener('touchmove', stopScrolling, false); });
参考:http://zhihu.com/question/29502345/answer/44612517
另外游戏有一个bug,没有判断小鸟的位置是否超出屏幕顶部的距离。
可以让小鸟直接飞出屏幕,在高空一直飞一直飞。
感谢提醒,web页面下拉刷新是特定客户端提供的功能,教程demo只是演示Hilo功能,并没有去适配各种客户端。
我在360极速浏览器上打开index.html是白屏,这是为啥
教程中提供的Flappy Bird代码没有禁止web页面上下拉,在部分手机上会出现抖动。
可以通过下面的方法解决:
$(document).ready(function() { function stopScrolling(touchEvent) { touchEvent.preventDefault(); } document.addEventListener('touchstart', stopScrolling, false); document.addEventListener('touchmove', stopScrolling, false); });
参考:http://zhihu.com/question/29502345/answer/44612517