search

Home  >  Q&A  >  body text

javascript - How to disable the rubber band effect that appears on sarafi and IE on the mobile side

In the Safari browser on iOS, when the web page is scrolled to the top, you can scroll another distance like a rubber band and rebound after letting go. This effect also exists on Windows tablets.

Please tell me how to use css to disable this effect, because it often affects the scrolling inside the page. As far as I know, there is a css attribute that can be used.

Which one is it?

大家讲道理大家讲道理2788 days ago636

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-19 10:14:15

    document.addEventListener('touchStart',function(e){
                e.preventDefault();
            })

    The mobile version eliminates the rubber band effect by blocking the default event, but there is a disadvantage. The default event is blocked, the a label cannot be clicked, and the page must simulate a scroll bar

    reply
    0
  • Cancelreply