The element in the location of the mobile terminal has a sliding event. In order to prevent the underlying element from sliding, add touchmove.prevent, which results in the internal element being unable to slide. How to solve this problem?

there is a list in the mask layer, because there are too many, so use overflow to partially display. When you move the touchmove, the elements outside the mask will also scroll along, so the mask has been added to prevent default events, but its internal list can not be scrolled, how to solve it,

online problems reappear (please check in mobile mode with F12)

   

< hr >

what you want to achieve:
can slide internally, but the bottom layer cannot slide.
how to achieve it?

Apr.07,2022

go straight to the code, header is the equivalent of your mask

/ solve the problem that when the mask scrolls, the underlying page scrolls along with it /

var startY, endY; // 
$('-sharpheader').on('touchstart', function(e) {
    startY = e.targetTouches[0].pageY; // 
});

$('-sharpheader').on('touchmove', function(e) {
    endY = e.targetTouches[0].pageY; // 
    // ;
    if(e.cancelable && (($(this)[0].scrollHeight == ($(this).scrollTop() + $(this)[0].clientHeight) && endY < startY) || ($(this).scrollTop() == 0 && endY > startY))) {
        e.preventDefault(); 
        return;
    }
});

when you open the mask layer, body sets overflow: hidden; sets overflow: scroll;


did you solve the same problem

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8ac5f-46dd6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8ac5f-46dd6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?