|
|
| Ò³ÃæÆ®¶¯Í¼Æ¬(1) |
<body>
<div id='flying0' style='position:absolute;z-index:100;display:block'>
<a href='/xinxikuaidi.htm' target='_blank'><img src='/images/ad/wtofinish.gif'
border=0 ></a> </div>
<div id='flying1' style='position:absolute;z-index:100;display:block'>
</div>
<div id='flying2' style='position:absolute;z-index:100;display:block'>
</div>
<div id='flying3' style='position:absolute;z-index:100;display:block'>
</div>
<div id='flying4' style='position:absolute;z-index:100;display:block'>
</div>
<script>
var DivCount=3;
var x=new Array(DivCount);
var y=new Array(DivCount);
var vx=new Array(DivCount);
var vy=new Array(DivCount);
var sx=new Array(DivCount);
var sy=new Array(DivCount);
var i,w,h;
for (i=0;i<DivCount;i++)
{
x[i]=document.body.clientWidth*Math.random()+1-document.all["flying"+i].offsetWidth;
y[i]=document.body.clientHeight*Math.random()+1-document.all["flying"+i].offsetHeight;
vx[i]=Math.floor(9*Math.random()-5)+1;if(vx[i]==0)vx[i]=1;
vy[i]=Math.floor(9*Math.random()-5)+1;if(vy[i]==0)vy[i]=1;
sx[i]=Math.abs(vx[i]);
sy[i]=Math.abs(vy[i]);
}
setTimeout("bounce()", 100);
function bounce()
{
for(i=0;i<DivCount;i++){
w=document.body.clientWidth-document.all["flying"+i].offsetWidth;
h=document.body.clientHeight-document.all["flying"+i].offsetHeight;
x[i]=x[i]+vx[i];
if(x[i]>w){x[i]=w-1;vx[i]=-sx[i];}
if(x[i]<0){x[i]=0;vx[i]=sx[i];}
y[i]=y[i]+vy[i];
if (y[i]>h){y[i]=h-1;vy[i]=-sy[i];}
if (y[i]<0){y[i]=0;vy[i]=sy[i];}
document.all["flying"+i].style.posLeft=x[i]+document.body.scrollLeft;
document.all["flying"+i].style.posTop=y[i]+document.body.scrollTop;}
setTimeout("bounce()",100);
}
</script> |
|
|
|