swipeRight swipeLeft 在手机上面失效
老师, 为这什么这个效果在手机上不能滑动,求原因
老师, 为这什么这个效果在手机上不能滑动,求原因
2015-04-22
这是代码片段, 主要是document的默认事件, 需要自己禁止, zepto 没有全给你做了
container.delegate('li', 'tap', function () {
var _id = cId = $(this).data('id');
loadImg(_id);
document.addEventListener('touchmove', stopPrevent, false);
});
function stopPrevent(e) {
e.preventDefault();
return false;
}
var lock = false;
largeContainer.tap(function (e) {
$(this).hide();
document.removeEventListener('touchmove',stopPrevent, false);
})举报