欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

拉動滾動條加載數(shù)據(jù)的jquery代碼

 更新時間:2012年05月03日 20:10:42   作者:  
拉動滾動條加載數(shù)據(jù)的jquery代碼,需要的朋友可以參考下
復(fù)制代碼 代碼如下:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>拉動滾動條加載數(shù)據(jù)</title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var i = 4;$(window).bind("scroll", function (event)
{
//滾動條到網(wǎng)頁頭部的 高度,兼容ie,ff,chrome
var top = document.documentElement.scrollTop + document.body.scrollTop;
//網(wǎng)頁的高度
var textheight = $(document).height();
// 網(wǎng)頁高度-top-當前窗口高度
if (textheight - top - $(window).height() <= 100) { if (i >= 100) { return;
//控制最大只能加載到100
}
$('#div1').css("height", $(document).height() + 100);i++;
//可以根據(jù)實際情況,獲取動態(tài)數(shù)據(jù)加載 到 div1中
$('<div>' + i + '</div>').appendTo($('#div1'));
}
});
})
</script>
<style>
#div1 div
{
font-size: 100px;
background: #ccc;
margin-top: 5px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 1000px;" id="div1">
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
</div>
</form>
</body>
</html>

相關(guān)文章

最新評論