![](/img/trans.png)
[英]How to detect when a user has scrolled to the bottom of a div in jQuery?
[英]How to detect user has scrolled to bottom of web page on their iPhone
我想要一個可以在用戶滾動到他們 iPhone 上的網頁底部時調用的函數。 (例如,加載更多數據。)當您滾動到牆或新聞提要的底部時,這有點像 Facebook。
我已經嘗試過jQuery.scroll處理程序,但是當我在 iPhone 上測試它時它不起作用。 任何有效的答案都可以。 如果沒有必要,我不需要使用 jQuery。
使用window.onscroll
事件:
window.onscroll = function(ev) { alert(ev.offsetY); };
您需要根據scrollHeight
檢查滾動位置,看看您是否在底部。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.