#top_div{
position:fixed;
bottom:80px;
right:0;
display:none;
}
window.onscroll = function(){
var t = document.documentElement.scrollTop || document.body.scrollTop;
var top_div = document.getElementById( "top_div" );
var loading = document.getElementById("loading");
vv.innerHTML="document.body.scrollHeight:"+document.body.scrollHeight+" body offsetHeight:"+document.body.offsetHeight;
//scrollTop + clientHeight == scrollHeight
if( document.body.scrollTop+ document.body.clientHeight >= document.body.scrollHeight) {
top_div.style.display = "inline";
if(loading.style.display != "inline"){
loading.style.display = "inline";
count.value=(1+ parseInt(count.value));
setTimeout("addItem(count.value);",2000);
}
}
}
function addItem(i){
for(var j=0;j<10;j++){
var box = document.createElement("div");
content.appendChild(box);
box.style.cssText = "width:300px;font-size:12px;";
box.innerHTML="..........."+ i+""
}
loading.style.display = "none";
}
这里尽量多些
以便页面出现滚动条
loaing............................................................................................................