How can I add a onScroll event to iScroll4?
Asked Answered
R

2

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?

Restricted answered 13/12, 2011 at 10:57 Comment(0)
B
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

Bunin answered 26/1, 2012 at 21:1 Comment(0)
U
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

Upbraid answered 13/12, 2011 at 12:12 Comment(2)
This was exactly what I was looking for. There should be better iScroll documentation for these events!Dermatophyte
Hoi Manuel, I don't see any version information included in the link, would the line etc. shift if the source changes?\Motile

© 2022 - 2024 — McMap. All rights reserved.