Ionic 2 滚动事件 [英] Ionic 2 scroll event

查看:11
本文介绍了Ionic 2 滚动事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个离子滚动组件.我试图在滚动期间执行一些代码.在 Ionic 1 中,这可以使用 on-scroll 属性并传递一个函数.

I have an ion-scroll component. I'm trying to execute some code during scrolling. In Ionic 1 this was possible using the on-scroll attribute and passing a function.

文档也丢失了.Ionic 2 中是否有内置方法来检测滚动,还是我必须依靠使用 jQuery 或窗口滚动事件添加自己的事件处理程序?

The documentation is also missing. Is there a built in way in Ionic 2 to detect scrolling, or do I have to fall back on adding my own event handlers using jQuery or window scroll event?

推荐答案

我在这里找到了解决方案:滚动"在

I found a solution here: "On-scroll" not working in

"ngAfterViewChecked" 中使用 "addScrollEventListener".

这篇关于Ionic 2 滚动事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆