Prevent “overscrolling” of web page

前端 未结 8 2399
星月不相逢
星月不相逢 2020-11-28 01:23

In Chrome for Mac, one can \"overscroll\" a page (for lack of a better word), as shown in the screenshot below, to see \"what\'s behind\", similar to the iPad or iPhone.

8条回答
  •  再見小時候
    2020-11-28 01:55

    You can use this code to remove touchmove predefined action:

    document.body.addEventListener('touchmove', function(event) {
      console.log(event.source);
      //if (event.source == document.body)
        event.preventDefault();
    }, false);
    

提交回复
热议问题