jQuery响应滚动条事件功能,可实现针对jQuery滚动条状态的实时计算与响应功能,具有一定参考借鉴价值,对jQuery感兴趣的朋友可以参考下本篇文章。
|
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
31
32
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(function() {
var lazyheight = 0;
function showload() {
lazyheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
if ($(document).height() - 100 <= lazyheight) {
alert("xxx");
}
}
$(window).bind("scroll",
function() {
showload();
});
})
</script>
</head>
<body>
<img src="1.jpg"/><br/>
<img src="2.jpg"/><br/>
<img src="3.jpg"/>
</body>
</html>
|