【问题标题】:unbind touchmove event in jquery取消绑定 jquery 中的 touchmove 事件
【发布时间】:2012-02-29 23:28:27
【问题描述】:

我调用以下命令来防止在 Web 应用上滚动:

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

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

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

【问题讨论】:

  • ...而不是完全省略代码?

标签: jquery web-applications


【解决方案1】:
$('body').unbind('touchmove');

unbind docs:

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

【讨论】:

  • 太棒了!完美运行!谢谢你:)
【解决方案2】:

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

【讨论】:

  • 干杯!完美地完成工作:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-03-27
  • 1970-01-01
  • 2010-12-20
  • 1970-01-01
  • 2010-10-22
相关资源
最近更新 更多