好主机建站-建站不再是梦想

立即注册开通网站

 

售前咨询QQ:599166136
登录官方论坛:http://bbs.letgo.com.cn/
加入建站技术交流群: 广州维派建站交流①

极品仿windows进度条效果

<style type="text/css">
#divLoadCont{position:absolute; z-index:500; left:0; top:0; width:100%; height:98%; clip:rect(0,100%,100%,0); background-color:transparent; layer-background-color:white; }
#divLoad1{position:absolute; layer-background-color:silver; background-color:silver}
#divLoad2{position:absolute; left:0; top:0; layer-background-color:navy; background-color:navy}
#divLoadText{position:absolute; background-color:transparent; font-family:arial,helvetica; color:Navy; font-size:14px; }
</style>
<script language="JavaScript" type="text/javascript">
function lib_bwcheck(){ //Browsercheck (needed)
 this.ver=navigator.appVersion
 this.agent=navigator.userAgent
 this.dom=document.getElementById?1:0
 this.opera5=this.agent.indexOf("Opera 5")>-1
 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
 this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
 this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
 this.ie=this.ie4||this.ie5||this.ie6
 this.mac=this.agent.indexOf("Mac")>-1
 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
 this.ns4=(document.layers && !this.dom)?1:0;
 this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
 return this
}
var bw=new lib_bwcheck()
numImages=20 //速度
loaderWidth=300 //进度条长度

currentImg=0
function lib_doc_size(){
  this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
  this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
  if(!this.x2||!this.y2) return message('Document has no width or height')
  this.x50=this.x2/2;this.y50=this.y2/2;
  return this;
}
function lib_obj(obj,nest){
  nest=(!nest) ? "":'document.'+nest+'.'
  this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0; 
  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;
  this.ref=this.css
  this.w=this.evnt.offsetWidth||this.css.clip.width||
    this.ref.width||this.css.pixelWidth||0;
  return this
}
lib_obj.prototype.moveIt = function(x,y){
  this.x=x;this.y=y; this.css.left=x;this.css.top=y
}
lib_obj.prototype.clipTo = function(t,r,b,l,setwidth){
  this.ct=t; this.cr=r; this.cb=b; this.cl=l
  if(bw.ns4){
    this.css.clip.top=t;this.css.clip.right=r
    this.css.clip.bottom=b;this.css.clip.left=l
  }else{
    if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0
    this.css.clip="rect("+t+","+r+","+b+","+l+")";
    if(setwidth){this.css.pixelWidth=this.css.width=r;
    this.css.pixelHeight=this.css.height=b}
  }
}
var oLoad2
function startLoading(){
  page=new lib_doc_size()
  oLoadCont=new lib_obj('divLoadCont')
  oLoad=new lib_obj('divLoad1','divLoadCont')
  oLoad2=new lib_obj('divLoad2','divLoadCont.document.divLoad1')
  oLoadText=new lib_obj('divLoadText','divLoadCont.document.divLoad1')
  oLoad.moveIt(page.x50-loaderWidth/2,page.y50-20)
  oLoadText.moveIt(loaderWidth/2 - oLoadText.w/2,10)
  oLoad.clipTo(0,loaderWidth,40,0,1)
  oLoad2.per = loaderWidth/numImages
}
function loadIt(ok){
  currentImg++
  if(oLoad2) oLoad2.clipTo(0,oLoad2.per*currentImg,40,0,1)
  if(!ok){
    oLoadCont.css.visibility='hidden'
    oLoadCont=null; oLoad1=null; oLoad2=null;
  }
}
function loadIt_display(ok){
  currentImg++
  if(oLoad2) oLoad2.clipTo(0,oLoad2.per*currentImg,40,0,1)
  if(currentImg<=numImages) setTimeout("loadIt_display(1)",200)
  else{
    oLoadCont.css.visibility='hidden'
    window.location="http://www.letgo.com.cn"
  }
}
</script>
<div id="divLoadCont">
  <div id="divLoad1">
    <div id="divLoad2"></div><br>
    <div id="divLoadText">正在带您进入...</div>
  </div>
</div>
<script>
startLoading()
//onload=loadIt; //- LEAVE THIS LINE WHILE TESTING. UNCOMMENT WHEN READY
loadIt_display(1) //LEAVE THIS LINE WHILE TESTING. DELETE WHEN READY
</script>
本代码由<a href=http://www.letgo.com.cn>好主机</a>提供

 
[文章评论(0)] [ 点击数:] [打印本网页] [关闭本窗口]  

关注广州维派 你建网站,我来埋单!

网络营销之路 我们与您相伴

 

相关内容
查无记录
 

 

 

注册用户须知

免 责 申 明

粤ICP备12022451号

 关于我们

 联系我们

 如何支付

广州维派网络科技有限公司

(即好主机建站)

LetGo.com.cn 版权所有

 维派互联 (域名)

 数据中心 (空间)

 维信通 (微营销)

 

2016最新微营销,维信通正式上线,老用户尊享优惠。

自助建站  智能建站  企业网站建设  永久免费做网站  易邻网

  网络114企业名录  申请友情链接  

企业网站建设

安全狗-arp防火墙/ddosf防火墙

好主机自助建站

维信通

维品生活

克隆网站

做网站

智能建站

智能网站

企业建站

  

网站管理