优内建站网,专业建站,企业建站,免费建站,智能建站,个人建站!
主营企业建站,seo优化,手机网站,微信网站开发等业务!>> 繁体中文
用户名: 密 码: 验证码:    
企业建站,专业建站,模板建站,智能建站
 您现在的位置:首页 >> 特效代码 >> 详细内容>>        【字体:  】【颜色: 绿

网页星空动态星空背景特效代码

在百度搜索关于“网页星空动态星空背景特效代码”的内容

在谷歌搜索关于“网页星空动态星空背景特效代码”的内容

买空间、服务器就上威客主机网(VK163.COM) 虚拟主机评测+IDC导航=威客主机之家 标志设计
[内容提要] BODYbgColor=#000000onload=fly()SCRIPTlanguage=javascript!--SmallStars=30;LargeStars=10;SmallYpos=newArray();SmallXpos=newArray();LargeYp...

作者: 优内科技  来源: 优内科技  驻站日期:2008/11/12 【 加入收藏 】 【 打印此页 】 【 关闭

<BODY bgColor=#000000 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>
</Body>

添加到QQ书签 百度收藏 订阅到抓虾 添加到鲜果  新浪ViVi  365Key网摘  天极网摘  我摘  和讯网摘  yahoo  收藏到收客网  Digbuzz我挖网  添加到饭否  挖客  添加到google  

   【回到顶部】 【返回文章列表】 编辑:优内科技
⊕ 上一篇:ASP本地图片,音乐等防盗代码
⊕ 下一篇:自适应图片大小的弹出窗口
  相关新闻
返回首页 | 设为首页 | 添加收藏 | 关于我们 | 联系我们 | 企业文化 | 合作伙伴 | 诚聘英才 | 网站报价 | 企业资质 | 网站地图
邮箱登陆 E- mail:master@cck5.com 点击这里给我发消息 客服专员 QQ:310203268 点击这里给我发消息 技术咨询 QQ:22071287点击这里给我发消息 代理备案 QQ:529631515
丰富的网站建设经验,专业提供网站建设、网站制作、网页设计服务,专业设计,真诚服务,不满意不收费!
Copyright 2008 - 2025 cck5 Inc. All Rights Reserved 优内建站网络科技公司
本站部分资源来自网络,如有侵犯您的版权,请告之,我们将即刻删除!QQ:310203268
主要业务:网站建设企业建站专业建站智能建站SEO优化微信建站手机建站
本站ICP备案号:浙ICP备11019299号 中国电信增值ICP经营许可证
不良信息举报中心 江西网警 信息产业部门备案 企业法人营业执照
 
扫优内微信二维码
“码”上有惊喜