0
我想知道連續網站的代碼,如果我滾動到底部並返回頂部,否則。永不結束的滾動頁面(滾動頁面頂部和底部或其他)
我已經在半路上,我使用此代碼爲底頁:
$(document).ready(function() {
$(document).scroll(function(){
if (document.documentElement.clientHeight + $(window).scrollTop() >= $(document).height()) {
$(document).scrollTop(0);
}
});
});
我怎樣才能讓反之? 從頂部到底部?
編輯:
$(document).ready(function() {
$(document).scroll(function(){
if (document.documentElement.clientHeight + $(window).scrollTop() >= $(document).height()) {
$(document).scrollTop(0);
}
else if ($(window).scrollTop() <= 0) {
$(document).scrollTop($(document).height());
}
});
});
我想,代碼和它的作品,但我認爲這是一個小錯誤在那裏,我需要滾動多一點,從頂部到達底部,或者以其他方式,這是爲什麼發生?
感謝
我想這得到它,但它沒有工作,和我編輯我的代碼,檢查它的兄弟 – Mumir