How can I add a onScroll event to iScroll4?

user920041 picture user920041 · Dec 13, 2011 · Viewed 11.2k times · Source

The onScroll event is not yet supported by the iScroll4.

Is there a known way to extend the iScroll to support an onScroll event?

Answer

hillmark picture hillmark · Jan 26, 2012
myScroll = new iScroll('wrapper', { 
  onScrollMove: function() {
    console.log('onScrollMove');
  },
  onScrollEnd: function() {
    console.log('onScrollEnd');
  }
});

This is a quick example of how to register your callback functions following the advice of the earlier response to this question: https://stackoverflow.com/a/8489043