我想在頁面中創建一個包含無限可滾動內容的div。在網頁div上的'無盡的滾動'
爲了識別,以便從我已經寫入的數據基礎加載更多的數據可滾動內容的結束下列操作:
$(window).scroll(function(){
var wintop = $(window).scrollTop(), docheight = $(document).height(), winheight = $(window).height();
var scrolltrigger = 0.95;
if ((wintop/(docheight-winheight)) > scrolltrigger) {
lastAddedLiveFunc();
}
});
問題:以下代碼是用於創建所述環形渦旋,其適合在整個網頁,但我怎麼能寫一個'div'在網頁內?
(提示:一個確切的類似的事情是在Facebook上的北京時間,右側這實時顯示最近你的朋友的活動。)
你知道scrollHeight屬性的jQuery的等值?我知道我可以使用它在jQuery 1.7中發佈:$(「#dvContent」)。prop(「scrollHeight」);但是你知道任何純jQuery等價物嗎? – user3286556
不要以爲它存在。 $(「#dvContent」)。prop(「scrollHeight」)或$(「#dvContent」)[0] .scrollHeight似乎是您唯一的選擇。 – stafffan
我試過使用它,但它不起作用。請你看看它,讓我知道我錯了什麼,並保存我的生活:(?! http://jsfiddle.net/cyrus2013/FQSx4/2/ – user3286556