<style type="text/css">
html,body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td{
margin: 0;
padding:0;
}
*{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.waterfllow-loading{
z-index: 2000;
display:none;
}
.waterfllow-loading.active{
display:block;
}
.waterfllow-loading img.loading-progress{
position: fixed;
/*设置等待条水平居于窗口正中*/
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
/*不能设置margin-top:auto和margin-bottom:auto否则IE下bottom就不顶用了*/
bottom: 30px;
}
</style>
<div class="waterfllow-loading">
<img class="loading-progress" src="busy.gif">
</div>
<script type="text/javascript">
//图片查询中正对浏览器主页面滚动事件处理(瀑布流)。只能使用window方式绑定,使用document方式不起作用
$(window).on('scroll',function(){
if(scrollTop() + windowHeight() >= (documentHeight() - 50/*滚动响应区域高度取50px*/)){
waterallowData();
}
});
function waterallowData(){
$('.waterfllow-loading').addClass('active');
/*$.ajax({
url:url,
type:"post",
data: params,
success:function(data,textStatus,jQXHR){
//添加数据
...
//隐藏加载条
$('.waterfllow-loading.active').removeClass('active');
}
});*/
}
//获取页面顶部被卷起来的高度
function scrollTop(){
return Math.max(
//chrome
document.body.scrollTop,
//firefox/IE
document.documentElement.scrollTop);
}
//获取页面文档的总高度
function documentHeight(){
//现代浏览器(IE9+和其他浏览器)和IE8的document.body.scrollHeight和document.documentElement.scrollHeight都可以
return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}
function windowHeight(){
return (document.compatMode == "CSS1Compat")?
document.documentElement.clientHeight:
document.body.clientHeight;
}
<!DOCTYPE html>
<html lang="ch-cn">
<head>
<meta charset="utf-8">
<script type="text/javascript" src='jquery-1.9.1.js'></script>
<style type="text/css">
html,body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td{
margin: 0;
padding:0;
}
*{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.waterfllow-loading{
z-index: 2000;
display:none;
}
.waterfllow-loading.active{
display:block;
}
.waterfllow-loading img.loading-progress{
position: fixed;
/*设置等待条水平居于窗口正中*/
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
/*不能设置margin-top:auto和margin-bottom:auto否则IE下bottom就不顶用了*/
bottom: 30px;
}
</style>
</head>
<body style="background:#ff0;height:1000px;">
<div class="waterfllow-loading">
<img class="loading-progress" src="busy.gif">
</div>
</body>
<script type="text/javascript">
//获取页面顶部被卷起来的高度
function scrollTop(){
return Math.max(
//chrome
document.body.scrollTop,
//firefox/IE
document.documentElement.scrollTop);
}
//获取页面文档的总高度
function documentHeight(){
//现代浏览器(IE9+和其他浏览器)和IE8的document.body.scrollHeight和document.documentElement.scrollHeight都可以
return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
}
//获取页面浏览器视口的高度
function windowHeight(){
//document.compatMode有两个取值。BackCompat:标准兼容模式关闭。CSS1Compat:标准兼容模式开启。
return (document.compatMode == "CSS1Compat")?
document.documentElement.clientHeight:
document.body.clientHeight;
}
</script>
<script type="text/javascript">
//图片查询中正对浏览器主页面滚动事件处理(瀑布流)。只能使用window方式绑定,使用document方式不起作用
$(window).on('scroll',function(){
if(scrollTop() + windowHeight() >= (documentHeight() - 50/*滚动响应区域高度取50px*/)){
waterallowData();
}
});
function waterallowData(){
$('.waterfllow-loading').addClass('active');
/*$.ajax({
url:url,
type:"post",
data: params,
success:function(data,textStatus,jQXHR){
//添加数据
...
//隐藏加载条
$('.waterfllow-loading.active').removeClass('active');
}
});*/
}
</script>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有