脚本特效展示
以下代码加入<head>区域
以下代码加入<body>区域
<script language="javascript"> <!-- b=document.all; c=document.layers; t1=new array("trail1.gif",38,35,"trail2.gif",30,31,"trail3.gif",28,26,"trail4.gif",22,21,"trail5.gif",16,16) nos=parseint(t1.length/3) rate=50 ie5fix1=0; ie5fix2=0; for (i=0;i<nos;i++){ createcontainer("cur"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+t1[i*3]+"' width="+t1[(i*3+1)]+" height="+t1[(i*3+2)]+" border=0>")} function createcontainer(n,xp,yp,w,h,at,ht,op,st){ with (document){ write((!b) ? "<layer id='"+n+"' left="+xp+" top="+yp+" width="+w+" height="+h : "<div id='"+n+"'"+" style='position:absolute;left:"+xp+"; top:"+yp+"; width:"+w+"; height:"+h+"; "); if(st){ if (c) write(" style='"); write(st+";' ") } else write((b)?"'":""); write((at)? at+">" : ">"); write((ht) ? ht : ""); if (!op) closecontainer(n) } } function closecontainer(){ document.write((b)?"</div>":"</layer>") } function getxpos(n){ return (b) ? parseint(b[n].style.left) : c[n].left } function getypos(n){ return (b) ? parseint(b[n].style.top) : c[n].top } function movecontainer(n,dx,dy){ c=(b) ? b[n].style :c[n];c.left=dx;c.top=dy } function cycle(){ //if (ie5) if (document.all&&window.print){ ie5fix1=document.body.scrollleft; ie5fix2=document.body.scrolltop; } for (i=0;i<(nos-1);i++){ movecontainer("cur"+i,getxpos("cur"+(i+1)),getypos("cur"+(i+1))) } } function newpos(e){ movecontainer("cur"+(nos-1),(b)?event.clientx+ie5fix1:e.pagex+2,(b)?event.clienty+ie5fix2:e.pagey+2 ) } if(document.layers) document.captureevents(event.mousemove) document.onmousemove=newpos setinterval("cycle()",rate) //--> </script>