每个人生下来都是天使,不过这个世界上也存在着恶魔。恶魔是天使变的,因为这个世界充满了诱惑。
本文摘自:http://lucky.diy.myrice.com/javascriptexam/mengxhfireworks.htm<HTML> <HEAD> <TITLE>JavaScript 精彩实例 @ 【孟宪会之精彩世界】</TITLE> <META http-equiv=Content-Type content="text/html; charset=gb2312"> <script> <!-- var debrisnumber=40 var debriscolor=new Array() debriscolor[0]="FFAAAA" debriscolor[1]="AA0000" debriscolor[2]="770000" debriscolor[3]="AA4444" debriscolor[4]="EE4422" var x_debrispos var y_debrispos var x,y var x_random=new Array() var y_random=new Array() var max_explsteps=20 var i_explsteps=0 var i_color=0 var pause=10 function checkbrowser() { i_explsteps=0 x_debrispos=x y_debrispos=y for (i=0;i<=debrisnumber;i++) { x_random[i]=Math.ceil(40*Math.random())-20 y_random[i]=Math.ceil(40*Math.random())-20 } if (document.all) { for (i=0;i<=debrisnumber;i++) { var thisspan=eval("document.all.span"+i+".style") thisspan.visibility="VISIBLE" thisspan.posLeft=x_debrispos thisspan.posTop=y_debrispos } explode_IE() } if (document.layers) { for (i=0;i<=debrisnumber;i++) { var thisspan=eval("document.span"+i) thisspan.visibility="VISIBLE" thisspan.left=x_debrispos thisspan.top=y_debrispos } explode_NN() } } function explode_IE() { if (i_explsteps<=max_explsteps) { for (i=0;i<=debrisnumber;i++) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft+=x_random[i] thisspan.posTop+=y_random[i] } i_explsteps++ var timer=setTimeout("explode_IE()",pause) } else { for (i=0;i<=debrisnumber;i++) { var thisspan=eval("document.all.span"+i+".style") thisspan.visibility="HIDDEN" } clearTimeout(timer) } } function explode_NN() { if (i_explsteps<=max_explsteps) { for (i=0;i<=debrisnumber;i++) { var thisspan=eval("document.span"+i) thisspan.left+=x_random[i] thisspan.top+=y_random[i] } i_explsteps++ var timer=setTimeout("explode_NN()",pause) } else { for (i=0;i<=debrisnumber;i++) { var thisspan=eval("document.span"+i) thisspan.visibility="HIDDEN" } clearTimeout(timer) } } function handlerMM(e){ x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY } if (document.layers){ document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = handlerMM; --> </script> <style> .spanstyle { position:absolute; visibility:hidden; } </style> </head> <body bgcolor="#000000" text="FFFFFF" link="FF0000" alink="FF0000" vlink="FF0000"> <script> <!-- for (i=0;i<=debrisnumber;i++) { document.write("<div id='span"+i+"' class='spanstyle'>") document.write("<table cellpadding=0 cellspacing=0>") document.write("<tr><td bgcolor="+debriscolor[i_color]+">") document.write("<img src='emptypixel236.gif' width=3>") document.write("</td></tr></table>") document.write("</div>") i_color++ if (i_color>=debriscolor.length) {i_color=0} } --> </script> <DIV id="redir" style="position:absolute;top:10px;left:5px;visibility:visible"> <table width=580 cellpadding=5 cellspacing=0 border=0><tr><td align=center><br><br><br><br><br><br> <a href="http://elove.heha.net" onMouseOver="checkbrowser()" target="_blank">点击这里查看效果</a> </td></tr></table> </DIV> <center> <form> <input type="button" value="关闭本页" onClick="window.close()" name="button"> </form></center> </body> </html>
posted on 2005-12-09 16:50 hyamw 阅读(253) 评论(0) 收藏 举报
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3