取消jQuery中的touchmove事件 [英] unbind touchmove event in jquery

查看:354
本文介绍了取消jQuery中的touchmove事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调用以下内容来防止在Web应用上滚动:

I invoke the following to prevent scrolling on a web app:

$('body').bind('touchmove', function(e){e.preventDefault()});

但是在一页上,我需要取消此操作.与此相反的是什么?因此,当页面被调用时,我可以调用类似的内容:

But on one page I need to cancel this. What would the opposite of this be? So when the page is called, I can call something like:

$('body').bind('touchmove', function(e){e.preventDefault() == TRUE});之类的

推荐答案

$('body').unbind('touchmove');

unbind 文档:

unbind docs:

说明:从元素中删除以前附加的事件处理程序.

Description: Remove a previously-attached event handler from the elements.

这篇关于取消jQuery中的touchmove事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆