<script>
function go()
{
window.open(...);
}
</script>
onblur="go();"-----new.asp-----
<script>
function come()
{
window.opener.location.reload(1);
}<body onload="come();">
function go()
{
window.open(...);
}
</script>
onblur="go();"-----new.asp-----
<script>
function come()
{
window.opener.location.reload(1);
}<body onload="come();">
function go()
{
window.open("new.htm");
}
</script>
onblur="go();"-----new.htm-----
<script>
function come()
{
if(window.openner!=null)
{document.write("loading the webpag");
window.opener.location.reload();
window.close();
}
}
<body onload="come();">
{
this.root = imgRoot||''
this.runAt = 0
this.preImg = new Array()
this.done = 0
this.f = 0
this.to = 0
eval(this.obj + '=this')
}
seLoader.prototype.runAtEnd = function(fct)
{
this.runAt = fct
}
seLoader.prototype.setImgs = function()
{
this.imgs = arguments
}
seLoader.prototype.load = function()
{
this.loadTxt = document.getElementById('seLoadTxt')
this.bar = document.getElementById('seLoadBar').style
for(i=0;(this.imgs[i]);i++)
{
this.preImg[i] = new Image()
this.preImg[i].src = this.imgs[i].indexOf('http')==-1 ? this.root + this.imgs[i] : this.imgs[i]
}
this.checkLoad()
}
seLoader.prototype.drawLoader = function(preTxt)
{
this.startTxt = preTxt ? preTxt : ''
document.writeln('<div id="seLoader"><div id="seLoadBox"><div id="seLoadBar"></div></div><div id="seLoadTxt">' + (this.startTxt!=''?this.startTxt:'0%') + '</div></div>')
}
seLoader.prototype.checkLoad = function()
{
for(i in this.preImg)
{
if(this.preImg[i].complete)
{
this.f = new Number(i)
this.f++
this.bar.width = Math.round(this.f/this.preImg.length*100) + '%'
this.loadTxt.innerHTML = new String(this.startTxt+this.bar.width)
status = this.preImg[i].src + ' loaded'
}
}
if(this.f!=this.preImg.length)
{
clearTimeout(this.to)
this.to = setTimeout(this.obj+'.checkLoad()',25)
}
else
{
status = this.imgs.length + ' images loaded.'
if(this.runAt) eval(this.runAt)
}
}
------------------
复制代码到head
<style type="text/css">
/* Container of Loader */
#seLoader
{
width : 200px; /* set width of loader */
z-index : 1;
margin : auto;
}/* Box around loadbar */
#seLoadBox
{
height : 12px; /* set height */
z-index : 3;
border : 1px solid;
padding : 1px;
background-color : #efefef;
font-size : 0px;
text-align : left;
}/* loadbar */
#seLoadBar
{
width : 0%;
height : 100%;
z-index : 4;
background : #f90;
}/* text (%) */
#seLoadTxt
{
z-index : 5;
margin-top : -14px;
font : 10px Verdana,Geneva,sans-serif;
}
</style>
<script src="seLoader.js" type="text/javascript"></script>
<script type="text/javascript">
load = new seLoader('img/') // make loader object and set the directory (dir optional)
load.runAtEnd('setTimeout(\'viewPage()\',10)') // run a script after loading (optional)
load.setImgs // set the images
(
'Image1.gif','Image2.gif','Image3.gif','Image4.gif','Image5.gif','Image6.gif','Image7.gif',
'Image8.gif','Image9.gif','Image10.gif','Image11.gif','Image12.gif','Image13.gif','Image14.gif','Image15.gif',
'Image16.gif','Image17.gif','Image18.gif','Image19.gif'
)function viewPage()
{
location.replace('http://www.hot4.org/java')
}function initLoader()
{
load.load()
}
onload=initLoader
</script>
注明:前半部分是设定进度条的颜色和规格
load = new seLoader('img/') // make loader object and set the directory (dir optional)这里是设定读取图片的位置
(
'Image1.gif','Image2.gif','Image3.gif','Image4.gif','Image5.gif','Image6.gif','Image7.gif',
'Image8.gif','Image9.gif','Image10.gif','Image11.gif','Image12.gif','Image13.gif','Image14.gif','Image15.gif',
'Image16.gif','Image17.gif','Image18.gif','Image19.gif'
)这里是读取图片的名字复制代码到body
<div align="center">
<script>load.drawLoader('now loading...')</script>
</div>