如何向 iScroll4 添加 onScroll 事件?

发布于 2024-12-21 04:54:20 字数 162 浏览 3 评论 0原文

iScroll4 尚不支持 onScroll 事件。

是否有已知的方法来扩展 iScroll 以支持 onScroll 事件?

The onScroll event is not yet supported by the iScroll4.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无畏 2024-12-28 04:54:20
myScroll = new iScroll('wrapper', { 
  onScrollMove: function() {
    console.log('onScrollMove');
  },
  onScrollEnd: function() {
    console.log('onScrollEnd');
  }
});

这是一个简单示例,说明如何按照之前对此问题的答复的建议来注册回调函数:https://stackoverflow.com/a /8489043

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

痴情 2024-12-28 04:54:20

看看这里的源代码: https://github .com/cubiq/iscroll/blob/v4/src/iscroll.js#L127-L139

第 127-139 行,您会发现可以指定一个 onScrollStart 函数。

也许您可以使用 onScrollStartonScrollMoveonScrollEnd 回调来调整您的方式

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文