跟随鼠标的漂亮光环,背景颜色为黑色看起来比较酷。
<body bgcolor="#000000">
<a href="<#ZC_BLOG_HOST#>">源码搜藏网</a>,站长必备的高质量网页特效和广告代码。codesocang.com,站长js特效。<hr>
<!--欢迎来到源码搜藏网,我们网站收集大量高质量js特效,提供许多广告代码下载,网址:www.codesocang.com,zzjs@msn.com,用.net打造靓站-->
<SCRIPT LANGUAGE="JavaScript">
ns = (document.layers) ? 1 : 0;
Clrs = new Array('ff0000', '00ff00', 'ffffff', 'ff00ff', 'ffa500', 'ffff00', '00ff00', 'ffffff', 'ff00ff')
yBase = 0;
xBase = 0;
step = 3;
currStep = 0;
Ypos = 0;
Xpos = 0;
if (ns)
{
for (i = 0; i < 14; i++)
document.write('<LAYER NAME="n' + i + '" LEFT=0 TOP=0 CLIP="0,0,' + i / 4 + ',' + i / 4 + '"></LAYER>');
window.captureEvents(Event.MOUSEMOVE);
function nMouse(evnt)
{
Ypos = evnt.pageY;
Xpos = evnt.pageX;
}
window.onMouseMove = nMouse;
} //欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
else
{
document.write('<div style="position:absolute;top:0;left:0"><div style="position:relative">');
for (i = 0; i < 14; i++)
{ document.write('<div id="me" style="position:absolute;top:0;left:0;width:' + i / 4 + ';height:' + i / 4 + ';font-size:' + i / 4 + '"></div>') }
document.write('</div></div>');
function iMouse()
{
Ypos = event.y + document.body.scrollTop;
Xpos = event.x + document.body.scrollLeft;
}
document.onmousemove = iMouse;
} //欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
function Comet()
{
var yBase = (document.layers) ? window.innerHeight / 4 : window.document.body.clientHeight / 4;
var xBase = (document.layers) ? window.innerWidth / 4 : window.document.body.clientWidth / 4;
for (i = 0; i < 14; i++)
{
var randCol = Math.round(Math.random() * 8);
var layer = (document.layers) ? document.layers['n' + i] : me[i].style;
layer.top = Ypos + yBase * Math.cos((currStep + i * 4) / 12) * Math.cos(0.7 + currStep / 200);
layer.left = Xpos + xBase * Math.sin((currStep + i * 3) / 10) * Math.sin(8.2 + currStep / 400);
if (ns) layer.bgColor = Clrs[randCol];
else
layer.background = Clrs[randCol];
}
currStep += step;
setTimeout("Comet()", 10);
}
window.onload = Comet;
</script>
</body>
相关内容推荐