在开发前端页面的时候,监听了touch start touchmove和touchend事件,结果发现经常不会触发touchend事件,调试了很久,后来发现,只要在touchmove中preventDefault阻止默认事件的执行就可以触发touchend事件,解决完这个问题后,放狗搜了下,找到了个比较靠谱的解释:
http://stackoverflow.com/questions/7691551/touchend-event-in-ios-webkit-not-firing
大概就是说,touchmove阶段,系统会判断是否需要滚动,如果touchmove阶段没有阻止默认滚动事件,那么系统就会接管touch事件,并触发touchcancle事件。。
恩,自从有了weinre,踩坑也不是很担心了。。
转载请注明:Findever » ios/android4.4+不触发touchend事件