当滚动条滑到底部时自动加载内容
"Content-Type" content="text/html;charset=UTF-8"/>
>
body{
background-color: #808080;
}
#main{
margin:0 auto;
width: 960px;
}
#content{
position: absolute;
width: 960px;
}
#img{
margin: 0;
padding: 0;
}
#img li{
list-style-type: none;
background-color: salmon;
margin: 0;
margin-top:10px;
border-bottom: solid 1px hotpink;
text-align: center;
}
"main">
"content">
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
src="js/jquery-1.7.2.min.js">
>
var content=document.getElementById("img").innerHTML;
function addLi(){
document.getElementById("img").innerHTML+=content;
}
$(window).scroll(function(){
var htmlHeight=document.body.scrollHeight||document.documentElement.scrollHeight;
var clientHeight=document.body.clientHeight||document.documentElement.clientHeight;
var scrollTop=document.body.scrollTop||document.documentElement.scrollTop;
if(scrollTop+clientHeight==htmlHeight){
addLi();
}
})