2014-05-09 72 views
1

jQuery的滾動不適合移動設備jQuery的滾動工作不適合移動設備

在這裏工作是我的代碼:

$(document).scroll(function() { 
    if ($(window).scrollTop() + $(window).height() >= $(document).height()) { 
     alert("scrolled"); 
    } 
}); 

任何一個可以幫助請...

+0

你找到解決辦法嗎?我太努力了.. – Priyanka

回答

0

也許是因爲不兼容的在不同的瀏覽器和平臺之間。

嘗試使用$(window).scroll代替$(document).scroll

$(window).scroll(function() { 
    if ($(window).scrollTop() + $(window).height() >= $(document).height()) { 
     alert("scrolled"); 
    } 
}); 
+1

它適用於臺式機,但不適用於移動設備。我需要移動設備.. – Satz