| 综合资源导航: |
本站导航
最新关注
QQ排行榜
推荐图文
论坛热点
| ·中国对西方十大迷信排行榜· |
|
·关于毛泽东的评价· |
|
·圣诞与毛诞· |
|
·我们为什么空虚· |
|
· 一个天方夜潭式的现代神话· |
|
·谈英语政策误中国· |
热门排行榜
网页背景特效代码系列
作者:转载 发布时间:2008-01-14 22:23:39 浏览次数:32551 星空背景
第一步:把如下代码加入到<body>区域中
<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>
第二步:把“onLoad="fly()"”加在<body>标记里
例如:<body onLoad="fly()">
背景:闪动小图片
背景FLASH
网页横条背景图
动态的gif图片
人物素材
浪漫钟表系列
超可爱的动态小人
窗帘式花边分割线
少见的竖状分隔线
Flash素材系列
动态背景边框素材
1000个16x16透明gif专集
进入
网页素材大全
进入
网站博客制作
|
![]() · 大 话 陆 军 专 栏 · |
![]() · 大 话 空 军 专 栏 · |
![]() · 大 话 海 军 专 栏 · |
![]() · 军 史 回 眸 专 栏 · |
|
![]() 最新99G坦克现身 |
![]() 中国变相承认歼18!(图) |
![]() 应对肢解中国的大危机 |
![]() 中国军事强大就安全了吗 |
![]() 朝鲜战争:立国之战 |
![]() 中国对西方十大迷信 |
![]() 中美战略博弈演义 |
![]() • 亲 历 现 代 战 争 • |
![]() • Q Q 聊 天 表 情 • |
![]() • 经 典 影 视 赏 析 • |
![]() • 音 画 朗 诵 鉴 赏 • |
|
![]() 世纪伟人李鸿章 |
![]() 李敖:审判华盛顿 |
![]() QQ2011模块套装 |
![]() 恶趣十足QQ色表情 |
![]() 恐怖QQ表情大全 |
![]() 真人搞笑QQ表情大全 |
![]() 十大样板戏全集观看 |
| 网站首页 | 关于本站 | 广告服务 | 免责声明 | 意见反馈 | 申请链接 | 推荐信息 | 官方论坛 | QQ宝典 | 收录查询 | 加入收藏 | 设为首页 |






































