日期:2014-05-18 浏览次数:20272 次
以下是HTML脚本特效代码,点击运行按钮可查看效果: 以下是程序代码<html></font> <font face=Verdana><head> <title>爱易网网页特效 - 围绕鼠标的立体星环</title> <meta content="text/html; charset=gb2312" http-equiv="Content-Type"></font> <font face=Verdana><script language="JavaScript"> <!-- ns=(document.layers)?1:0; Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff') var amount=8 var step=0.3; var currStep=0; var Ypos=0; var Xpos=0; if (ns){ for (i=0; i < amount; i++) document.write('<LAYER NAME="n'+i+'" LEFT=0 TOP=0 BGCOLOR=#FFFFFF CLIP="0,0,2,2"></LAYER>'); window.captureEvents(Event.MOUSEMOVE); function nMouse(evnt){ Ypos = evnt.pageY; Xpos = evnt.pageX; } window.onMouseMove=nMouse; } else{ document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (i=0; i < amount; i++) document.write('<div id="me" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#00aaff"></div>'); document.write('</div></div>'); function iMouse(){ Ypos=event.y+document.body.scrollTop; Xpos=event.x+document.body.scrollLeft; } document.onmousemove = iMouse; } function Comet(){ for (i=0; i < amount; i++){ var randCol=Math.floor(Math.random()*Clrs.length); var layer=(document.layers)?document.layers['n'+i]:me[i].style; layer.top =Ypos+60*Math.sin((currStep + i*3.1)/4)*Math.cos(currStep/10); layer.left=Xpos+60*Math.cos((currStep + i*3.1)/4); if (ns) layer.bgColor=Clrs[randCol];else layer.background=Clrs[randCol]; } currStep+=step; setTimeout("Comet()",10); } window.onload=Comet; // --> </script></font> <font face=Verdana></head></font> <font face=Verdana><body bgcolor="#000000"></font> <font face=Verdana></body> </html></font> <a href="http://www.aiyiweb.com/HTML/jsrun/">欢迎访问爱易网网页脚本特效集</a> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]