ajax-禁止的默认事件 再 还原

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zjl199303/article/details/69389883
问题1:页面滑动失灵,卡顿
解决:   阻止默认事件

问题2: 阻止默认事件后,输入框等不能获取焦点,右上角点的按钮 不能跳转页面
解决:  阻止的默认事件再绑定。

方法: 
$("#id").on(' touchstart',function(){
       ...........
       $("#id").on('touchmove',function(event) {
              event.preventDefault();
        }, false);
})
$("#id").on(' touchend',function(){
        ..........
        $("#id").unbind('touchmove');
})

猜你喜欢

转载自blog.csdn.net/zjl199303/article/details/69389883