yansj1997
/**
 * 禁止手机浏览器拖动
 */
function stopDefault(){
     window.ontouchmove = function(e){
         e.preventDefault && e.preventDefault();
         e.returnValue = false;
         e.stopPropagation && e.stopPropagation();
         return false;
     }
     document.body.style.height = \'100%\';
     document.body.style.overflow = \'hidden\';
}

/*
 * 允许手机浏览器拖动
 */
function startDefault(){
     window.ontouchmove = function(e){
         e.preventDefault && e.preventDefault();
         e.returnValue = true;
         e.stopPropagation && e.stopPropagation();
         return true;
     }
     document.body.style.height = \'auto\';
     document.body.style.overflow = \'auto\';
}

 

分类:

技术点:

相关文章:

  • 2021-12-05
  • 2022-12-23
  • 2021-10-11
  • 2021-04-14
  • 2021-12-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案