在jquery中取消绑定touchmove事件

时间:2012-02-08 14:04:33

标签: jquery web-applications

我调用以下内容以阻止在网络应用上滚动:

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

但是在一个页面上我需要取消它。与此相反的是什么?所以当调用页面时,我可以调用类似的东西:

$('body').bind('touchmove', function(e){e.preventDefault() == TRUE});或其他什么

2 个答案:

答案 0 :(得分:3)

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

unbind docs:

  

描述:从元素中删除以前附加的事件处理程序。

答案 1 :(得分:0)

相反的是$('body').unbind('touchmove');