首页
网页特效库
网页特效库
导航菜单
按钮表单
背景特效
时间日期
图片特效
鼠标特效
文本操作
窗口页面
状态栏类
警告对话
综合应用
游戏娱乐
首页
>
特效
>
背景特效
> 正文
横向飘过的夜空星星
2011-09-27 背景特效 965℃
<html> <head> <title>Typhoon Start JavaScript Fairyland</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body bgcolor="#000000" text="#999999" link="#33FF33" vlink="#33FF33" alink="#33FF33" onLoad="fly()"> <script language="JavaScript"> <!-- SmallStars = 30; LargeStars = 10; SmallYpos = new Array(); SmallXpos = new Array(); LargeYpos = new Array(); LargeXpos = new Array(); Smallspeed= new Array(); Largespeed= new Array(); ns=(document.layers)?1:0; if (ns){ for (i = 0; i < SmallStars; i++) {document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>")} for (i = 0; i < LargeStars; i++) {document.write("<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFFF' CLIP='0,0,2,2'></LAYER>")} } else{ document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (i = 0; i < SmallStars; i++) {document.write('<div id="si" style="position:absolute;top:0;left:0;width:1px;height:1px;background:#fffff0;font-size:1px"></div>')} document.write('</div>'); document.write('</div>'); document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (i = 0; i < LargeStars; i++) {document.write('<div id="li" style="position:absolute;top:0;left:0;width:2px;height:2px;background:#ffffff;font-size:2px"></div>')} document.write('</div>'); document.write('</div>'); } WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight; WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth; //Inital placement! for (i=0; i < SmallStars; i++) { SmallYpos[i] = Math.round(Math.random()*WinHeight); SmallXpos[i] = Math.round(Math.random()*WinWidth); Smallspeed[i]= Math.random()*5+1; } for (i=0; i < LargeStars; i++) { LargeYpos[i] = Math.round(Math.random()*WinHeight); LargeXpos[i] = Math.round(Math.random()*WinWidth); Largespeed[i]= Math.random()*10+5; } function fly(){ var WinHeight=(document.layers)?window.innerHeight:window.document.body.clientHeight; var WinWidth=(document.layers)?window.innerWidth:window.document.body.clientWidth; var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop; var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft; for (i=0; i < LargeStars; i++) { LargeXpos[i]-=Largespeed[i]; if (LargeXpos[i] < -10) { LargeXpos[i]=WinWidth; LargeYpos[i]=Math.round(Math.random()*WinHeight); Largespeed[i]=Math.random()*10+5; } if (ns){ document.layers['ln'+i].left=LargeXpos[i]; document.layers['ln'+i].top=LargeYpos[i]+hscrll; } else{ li[i].style.pixelLeft=LargeXpos[i]; li[i].style.pixelTop=LargeYpos[i]+hscrll; } } for (i=0; i < SmallStars; i++) { SmallXpos[i]-=Smallspeed[i]; if (SmallXpos[i] < -10) { SmallXpos[i]=WinWidth; SmallYpos[i]=Math.round(Math.random()*WinHeight); Smallspeed[i]=Math.random()*5+1; } if (ns){ document.layers['sn'+i].left=SmallXpos[i]; document.layers['sn'+i].top=SmallYpos[i]+hscrll; } else{ si[i].style.pixelLeft=SmallXpos[i]; si[i].style.pixelTop=SmallYpos[i]+hscrll; } } setTimeout('fly()',10); } //fly(); //--> </script> <p> </body> </html>
相关特效代码
CSS 横向图片列表
03/04
神秘飘过来的AD窗口会自动关闭
12/22
鼠标单击处崩出七彩星星
12/19
舞动星星包围你的鼠标
12/19
星星从背景中飞出特效
11/24
CSS横向下拉菜单
11/24
微软风格的CSS横向菜单
11/24
用CSS控制的横向列表菜单
11/24
横向二级导航菜单
11/24
热门特效代码
JavaScript烟花特效
网页背景色在线调色选色
星星从背景中飞出特效
横向飘过的夜空星星
斜向移动落叶背景
网页背景色全目录
点击按钮切换背景颜色的JavaScri
改变底纹的链接效果
可选择的网页背景颜色
下大雨效果的网页背景
推荐特效代码
可选择的网页背景颜色
很不错的背景调色板
星星从背景中飞出特效
斜向移动落叶背景
JavaScript烟花特效
点击按钮切换背景颜色的JavaScri