扫码关注官方订阅号
页面引入zepto.js之后会默认给body绑定一个touchmove方法
zepto.js
body
touchmove
我首先想到的是使用 removeEventListener()方法,但是要移出的事件函数为必填。这里不知道如何处理? element.removeEventListener(event, function, useCapture)
removeEventListener()
element.removeEventListener(event, function, useCapture)
光阴似箭催人老,日月如移越少年。
document.removeEventListener("touchmove", self.pageLockHandler, false); function pageLockHandler(e) { e.preventDefault(); }
之所以把这函数拆出来,是有可能你在特定情况下还需要再次绑定~
已经解决了。$('body').off('touchmove')
$('body').off('touchmove')
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
之所以把这函数拆出来,是有可能你在特定情况下还需要再次绑定~
已经解决了。
$('body').off('touchmove')