js滚动条动态加载数据

     <! DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
     < html  xmlns ="http://www.w3.org/1999/xhtml"  lang ="zh-CN" >
     < head >
     < meta  http-equiv ="Content-Type"  content ="text/html; charset=gb2312"   />
     < script  type ="text/javascript"  src ="http://www.miiceic.org.cn/templets/js/jquery-1.3.1.js" ></ script >
     < title >企业培训,it培训,数据库培训,android培训,嵌入式培训 </ title >
     </ head >  
        < script  type ="text/javascript" >
        
function  insertcode(){
            
var  $body  =  $( " body " );                                                           
            $body.append(
' <div style=\" height:1000px; font-size:24px;\"><a href=\"http://www.miiceic.org.cn/\" target=\"_blank\">企业培训</a><br /><a href=\"http://www.amboedu.com/\" target=\"_blank\">职业教育</a><br /><a href=\"http://www.ciitn.com/\" target=\"_blank\">信息产业培训网</a><br /><a href=\"http://www.miiceic.org.cn/amt2011/\" target=\"_blank\">android PK Iphone</a><br /></div> ' )
            $(
" #page_tag_load " ).hide();                   
            }
        
function  endcode(){
            $(
" #page_tag_load " ).hide();
        }
        $(document).ready(
function (){
             $(window).scroll(
function  () {
                  
var  $body  =  $( " body " );
                  
var  $html  =   "" ;
                  $html 
+=   " <br/> "   +  ($(window).height()  +  $(window).scrollTop());
                  $html 
+=   " <br/>window.height:  "   +  $(window).height();
                  $html 
+=   " <br/>body.height:  "   +  $body.height();
                  $html 
+=   " <br/>window.scrollTop:  "   +  $(window).scrollTop();
                  $(
" #page_tag_bottom " ).html($html);

                 
/* 判断窗体高度与竖向滚动位移大小相加 是否 超过内容页高度 */
                  
if  (($(window).height()  +  $(window).scrollTop())  >=  $body.height()) {
                      $(
" #page_tag_load " ).show();
                      
// setTimeout(insertcode, 1000);/*IE 不支持*/
                       if (($(window).height()  +  $(window).scrollTop()) < 3000 ){   
                          insertcode();
                      }
                      
else {
                          endcode();   
                      }
                  }
              });
          });
        
</ script >
     </ head >

     < body >
         < div  style ="height:1000px; font-size:24px;" >< href ="http://www.miiceic.org.cn/"  target ="_blank" >企业培训 </ a >< br  />< href ="http://www.amboedu.com/"  target ="_blank" >职业教育 </ a >< br  />< href ="http://www.ciitn.com/"  target ="_blank" >信息产业培训网 </ a >< br  />< href ="http://www.miiceic.org.cn/amt2011/"  target ="_blank" >Android PK Iphone </ a >< br  />< br  />< br  />< href ="http://www.miiceic.org.cn/amt2011/"  target ="_blank" >跨领域技术体验峰会 </ a ></ div >
         < div  id ="page_tag_bottom"  style ="width:100%; position:fixed; _position:absolute;top:0px; background-color:#cccccc;height:120px;" ></ div >
         < div  id ="page_tag_load"  style =" display:none; font-size:14px;position:fixed; bottom:0px; background-color:#cccccc;height:50px;" >加载中... </ div >
     </ body >
     </ html >

转载于:https://www.cnblogs.com/jinqi79731/archive/2012/02/01/2334512.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值