iPad scrolling - what events fire during scrolling?

10,443

The problem is that on an iPad the scroll does not continuously fires. It only fires once when you stop scrolling. As far as I know you cannot solve this.

On the desktop this is not the case. Here during scrolling the browser continuously fires the scroll event.

I noticed this behaviour when I was working on a parallax scrolling website. On iOS everything stuttered because the scroll event was only firing once.

However it is possible to simulate as described here: javascript scroll event for iPhone/iPad?

Share:
10,443
Sam
Author by

Sam

Updated on July 26, 2022

Comments

  • Sam
    Sam almost 2 years

    I've been searching around to find out what events are triggered when you scroll on an iPad on webpages.

    There is this source: https://developer.apple.com/library/safari/#documentation/appleapplications/reference/SafariWebContent/HandlingEvents/HandlingEvents.html

    Which indicates the following are fired:

    ontouchstart="touchStart(event);"
    
    ontouchmove="touchMove(event);"
    
    ontouchend="touchEnd(event);"
    
    ontouchcancel="touchCancel(event);"
    

    The problem is how to deal with the momentum scrolling when a user flicks to scroll. I think the onsroll event only fires when the scrolling has finished.

    Does anyone know if any events are fired when the momentum scrolling is occuring so you can do checks as the page is scrolling under this 'momentum'?

    cheers

    • Klaas Leussink
      Klaas Leussink over 11 years
      Have you checked if the scroll event on the window fires during momentum scrolling? Example: $(window).scroll(function(){ console.log('scrolling') });
    • d_rail
      d_rail over 8 years
      It's currently not possible to open a dev console on an iPad. However, from my limited experience, it does not fire when the window is momentum scrolling.
    • bvpb
      bvpb over 6 years
      You can use Safari Web Inspector to debug Safari on iOS. This capability has been around for a while.