报错1:
touch_events.html:27 Uncaught TypeError: $(...).tap is not a function
原因:zepto将部分功能都分散在各自的模块了
解决:如果用tap功能,需要去github下载touch.js模块并引入;
------------------------------------------------------------------------------------------------------
报错2:使用swipe滑动功能不报错,也不执行功能
$('#items li').swipe(function() { console.log(111); })
原因:浏览器有默认的下拉事件
解决:加入下面代码阻止浏览器默认事件
document.addEventListener('touchmove', function (event) { event.preventDefault(); }, false);
报错3:接着报错二,加入了阻止默认事件后,滑动功能可以执行,但是控制台还会报错
touch.js:110 Uncaught TypeError: Cannot read property 'trigger' of undefined at touch.js:110原因:母鸡
解决:母鸡