pc端:

.not-select{
    -moz-user-select:none; /*火狐*/
    -webkit-user-select:none; /*webkit浏览器*/
    -ms-user-select:none; /*IE10*/
    -khtml-user-select:none; /*早期浏览器*/
    user-select:none;
}

移动:

.no-touch {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

js方法:

ontouchstart="return false;"

在需要禁止的dom上添加这段代码,两种方法对于安卓和IOS的支持没有单独测试过。两个同时使用,对于安卓和IOS可以起到禁止作用。

 

相关文章:

  • 2021-06-06
  • 2021-10-30
  • 2022-12-23
  • 2021-10-09
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-18
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
相关资源
相似解决方案