Browse Source

fix:苹果设备静止左右滚动

shenchunlv 2 years ago
parent
commit
db005672f9
1 changed files with 10 additions and 0 deletions
  1. 10 0
      public/aff.js

+ 10 - 0
public/aff.js

@@ -1,5 +1,15 @@
 var _hmt = _hmt || [];
 (function() {
+  window.onload = function () {
+    document.addEventListener('touchstart', function (event) {
+      if (event.touches.length > 1) {
+        event.preventDefault()
+      }
+    })
+    document.addEventListener('gesturestart', function (event) {
+      event.preventDefault()
+    })
+  }
   console.log('爱番番触发')
 var hm = document.createElement("script");
 hm.src = "https://hm.baidu.com/hm.js?38416d7ccaa6b3339741246fd9fc45fd";