How does the mobile monitor the distance the page rolls away?

this is what I originally wrote:

document.body.addEventListener ("scroll",function (e) {

)
    if ($(this).scrollTop() > 50 ) {// 
        $(".total-prices").addClass("position-top")
    }else{
        $(".total-prices").removeClass("position-top")
    }
})

but the mobile side of this is invalid, later Baidu said to use touchmove, but touchmove need to disable the default scrolling behavior, so the page can not be moved, so how to achieve?!

Mar.17,2021

then why did you stop it yourself? no, no, no.


has the landlord solved it?

Menu