大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 网页设计 -> 网页特效 -> 随鼠标的闪烁小星星

随鼠标的闪烁小星星

时间: 2021-07-31 作者:daque

把如次代码介入<body>地区中<script language="javascript"><!-- colours=new array('#ffffff','#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#fff000','#0000ff','#ffffff')

y = 0;x = 0;n6=(document.getelementbyid&&!document.all);ns=(document.layers);ie=(document.all);d=(ns||ie)?'document.':'document.getelementbyid("';a=(ns||n6)?'':'all.';n6r=(n6)?'")':'';s=(ns)?'':'.style';n=(n6)?9:10;if (ns){for (i = 0; i < n; i++)document.write('<layer name="dots'+i+'" top=0 left=0 width='+i/2+' height='+i/2+' bgcolor=#ff0000></layer>');}if (ie)document.write('<div id="con" style="position:absolute;top:0px;left:0px"><div style="position:relative">');if (ie||n6){for (i = 0; i < n; i++)document.write('<div id="dots'+i+'" style="position:absolute;top:0px;left:0px;width:'+i/2+'px;height:'+i/2+'px;background:#ff0000;font-size:'+i/2+'"></div>');}if (ie)document.write('</div></div>');

 

(ns||n6)?window.captureevents(event.mousemove):0;function mouse(evnt){y = (ns||n6)?evnt.pagey+4 - window.pageyoffset:event.y+4;x = (ns||n6)?evnt.pagex+1:event.x+1;}(ns)?window.onmousemove=mouse:document.onmousemove=mouse;

function animate(){h=(ns||n6)?window.innerheight:document.body.clientheight;w=(ns||n6)?window.innerwidth:document.body.clientwidth;

o=(ns||n6)?window.pageyoffset:0;if (ie)con.style.top=document.body.scrolltop;for (i = 0; i < n; i++){var temp1 = eval(d+a+"dots"+i+n6r+s);var randcolours = math.floor(math.random()*colours.length);(ns)?temp1.bgcolor = colours[randcolours]:temp1.background = colours[randcolours]; if (i < n-1){ var temp2 = eval(d+a+"dots"+(i+1)+n6r+s); temp1.top = parseint(temp2.top); temp1.left = parseint(temp2.left); } else{ temp1.top = y+o; temp1.left = x; }if ((y < h/10) || (y > h-h/10) || (x < w/10) || (x > w-w/10)){var temp3 = eval(d+a+"dots"+0+n6r+s);temp3.top = (y-25)+math.random()*50;temp3.left = (x-25)+math.random()*50;temp2.top = parseint(temp3.top)+o;temp2.left = parseint(temp3.left);}}settimeout("animate()",30);}animate();// --></script>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.