10

The onScroll event is not yet supported by the iScroll4.

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

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

2 Answers2

23
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

Community
  • 1
  • 1
hillmark
  • 807
  • 8
  • 22
4

have a look at the source here: https://github.com/cubiq/iscroll/blob/v4/src/iscroll.js#L127-L139

on lines 127-139 you'll see that you can specify a onScrollStart function.

Maybe you can tweak your way arround with the onScrollStart, onScrollMove and the onScrollEnd callbacks

jackocnr
  • 17,068
  • 10
  • 54
  • 63
Manuel van Rijn
  • 10,170
  • 1
  • 29
  • 52