在移动端body或者最外面的container要有滑动事件
当页面做编辑功能
需要将div设置成为可编辑 其中添加了一些事件
当实施编辑的过程中为了会触发这些编辑事件
在触发这类事件的同事会触发body或者container的滑动事件
这就是冒泡
而编辑过程中body是不可以滑动的
因此要阻止到body的滑动事件
方法:
function unbindEvent(){
$('body').bind('touchstart', function(event) {
event.stopPropagation();
});
$('body').bind('touchmove', function(event) {
event.stopPropagation();
});
$('body').bind('touchend', function(event) {
event.stopPropagation();
});
}