<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>一个精美的进度条效果</title>
<style type="text/css">
/*Loader
----------------------------------------------*/
#loader_container{text-align: center;position: absolute;top: 60%;width: 100%;left: 0;}
#loader{font-family: Tahoma, Helvetica, sans;font-size: 11.5px;color: #abc;background-color: #000;padding: 10px 0 16px 0;margin: 0 auto;display: block;width: 130px;border: 1px solid #abc;text-align: left;z-index: 2;}
#loader_bg{background-color: #abc;position: relative;top: 8px;left: 8px;height: 7px;width: 113px;font-size: 1px}
#progress{height: 5px;font-size: 1px;width: 1px;position: relative;top: 1px;left: 0px;background-color: #fff;}
</style>
<script type="text/javascript">
var t_id=setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
var elem=document.getElementById('progress');
if(elem!=null){
if(pos==0)len+=dir;
if(len>32||pos>79)pos+=dir;
if(pos>79)len-=dir;
if(pos>79&&len==0)pos=0;
elem.style.left=pos;
elem.style.width=len;
}
}function remove_loading()
{
this.clearInterval(t_id);
var targelem=document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
}</script>
</head><body onLoad="remove_loading();">
<script language="javascript">
//window.onLoad=remove_loading();
</script>
<div id="loader_container" onClick="this.style.display='none'" title="点击关闭">
<div id="loader">
<div align="center">网页正在载入中 ...</div>
<div id="loader_bg">
<div id="progress"> </div>
</div>
</div>
</div>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/5/322047_12441829709fN1_m.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/5/322047_1244182943UBqh_m.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/></body>
</html>
看我的body那里。我不想在body里面写。。在script里面。为什么我这样写就出错啊??哪位前辈帮忙看下啊。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>一个精美的进度条效果</title>
<style type="text/css">
/*Loader
----------------------------------------------*/
#loader_container{text-align: center;position: absolute;top: 60%;width: 100%;left: 0;}
#loader{font-family: Tahoma, Helvetica, sans;font-size: 11.5px;color: #abc;background-color: #000;padding: 10px 0 16px 0;margin: 0 auto;display: block;width: 130px;border: 1px solid #abc;text-align: left;z-index: 2;}
#loader_bg{background-color: #abc;position: relative;top: 8px;left: 8px;height: 7px;width: 113px;font-size: 1px}
#progress{height: 5px;font-size: 1px;width: 1px;position: relative;top: 1px;left: 0px;background-color: #fff;}
</style>
<script type="text/javascript">
var t_id=setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
var elem=document.getElementById('progress');
if(elem!=null){
if(pos==0)len+=dir;
if(len>32||pos>79)pos+=dir;
if(pos>79)len-=dir;
if(pos>79&&len==0)pos=0;
elem.style.left=pos;
elem.style.width=len;
}
}function remove_loading()
{
this.clearInterval(t_id);
var targelem=document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
}</script>
</head><body onLoad="remove_loading();">
<script language="javascript">
//window.onLoad=remove_loading();
</script>
<div id="loader_container" onClick="this.style.display='none'" title="点击关闭">
<div id="loader">
<div align="center">网页正在载入中 ...</div>
<div id="loader_bg">
<div id="progress"> </div>
</div>
</div>
</div>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/5/322047_12441829709fN1_m.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/5/322047_1244182943UBqh_m.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/>
<img src="http://home.blueidea.com/attachment/200906/9/497605_1244515646OPUU.jpg" width="120" height="90"/></body>
</html>
看我的body那里。我不想在body里面写。。在script里面。为什么我这样写就出错啊??哪位前辈帮忙看下啊。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货