jQuery live scroll event on mobile (work around)

后端 未结 3 1189
一生所求
一生所求 2020-11-28 03:26

The age old problem: Getting the scroll event to fire while a user is scrolling on an element while on a mobile site or app(web view).

All I\'m looking for is access

3条回答
  •  鱼传尺愫
    2020-11-28 03:39

    maybe you could take a look at how iScroll does it in their _move-method which is bound to the touchmove event: https://github.com/cubiq/iscroll/blob/master/src/core.js#L152

    It's a bit complicated but i'm sure you'll figure it out. You could also just use iScroll to begin with and bind to their scrollmove event (I'm not sure how it's called on iScroll 5 but it was onScrollMove in iScroll 4). that.y will then give you the correct value.

提交回复
热议问题