我有一個iron-list
,我使用iron-scroll-threshold
滾動到底部時添加了新項目。這工作正常。聚合物事件on-content-scroll沒有觸發
我還需要的是當滾動停止時觸發的一般事件。
我需要知道列出的項目(m.message)是否已經看到用戶,通過檢查哪些項目是目前在視口可見滾動,然後將它們標記爲「已讀」後。
<div class="container" on-content-scroll="_scrollHandler">
<iron-scroll-threshold id="threshold" scroll-target="mlist" lower-threshold="500" on-lower-threshold="_loadMoreData"></iron-scroll-threshold>
<iron-list items="[[messages]]" id="mlist" as="m">
<template>
<div>
<p>[[m.message]]</p>
</div>
</template>
</iron-list>
</div>
然而,處理程序_scrollHandler
從未被解僱。
在滾動結束後獲取事件需要什麼?
我把你的建議修改的地方,但不幸的是它還是不行。也許有一個與iron-list和/或iron-scroll-threshold的交互? – yglodt
看來你已經回答了你的問題......在任何情況下,請確保將答案標記爲接受,如果它幫助你了!我可以選擇編輯我的答案以包含更正後的解決方案。 –