Smipto
20D
V2EX  ›  问与答

为什么某些手机会出现上下滑动时导致页面容器上下移动?大佬解答一下

  •  
  •   Smipto · Sep 5, 2020 · 1473 views
    This topic created in 2252 days ago, the information mentioned may be changed or developed.
    本来一个好好的拼图游戏,现在上下不能滑动、、当然绝大部分是正常的,就小部分手机出现这样的问题,求大佬解答一下 视频: https://streamja.com/B4rmn


    2 replies  •  2020-09-05 10:25:26 +08:00
    Smipto
    Smipto
    OP
    Sep 5, 2020
    1
    在线等,求解~
    alphardex
    alphardex
    Sep 5, 2020❤️1
    2
    之前也碰到过,直接禁止页面容器滑动就行了
    ```js
    const disableTouchMove = () => {
    document.body.addEventListener('touchmove', e => {
    e.preventDefault()
    }, { passive: false });
    }
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2589 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 00:29 · PVG 08:29 · LAX 16:29 · JFK 19:29
    ♥ Do have faith in what you're doing.