今天是:
首 页信息查询网站SEO查询工具CSS编辑器建站素材
网海拾贝,电脑资讯,电脑快报,it资讯,网站建设资讯,教程基地
软件新闻
操作系统
Vista Winxp Win2003 Linux Windows综合
工具软件
系统工具 媒体工具 网络工具 杀毒软件 聊天
软件开发
C教程 C++ Java C# ASP.NET JSP PHP
数据库
Oracle MySQL DB2 SQL Server Sybase
安全
网络 病毒
办公应用
Word Excel Powerpoint Outlook 其他
平面设计
Photoshop Fireworks Coreldraw Flash Illustrator 3dsmax
网站运营
网站运营 网站优化 网站策划 策划书下载 建站心得 站长故事 网站盈利 网页制作 网页特效 建站素材 免费资源 QQ频道
  当前位置:首 页 >> 网页特效 >> 页面背景 >> 星星从背景中飞出

星星从背景中飞出

  发布于2005-11-07 19:38 来源:网海拾贝


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 2 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->

<style type="text/css">
.star {
position:absolute;
layer-background-color:white;
visibility:visible;
top:-50px;
width:50px;
height:50px;
font-size:1px;
background-color:white;
}
</style>
<script LANGUAGE="Javascript">
<!-- Begin
var starnum = 175; // Number of stars
var isNS = (document.layers);
var _all = (isNS)? '' : 'all.';
var _style = (isNS) ? '' : '.style';
var xoffset, yoffset, w_x, w_y, tmpx, tmpy, scrlx, scrly;
function getstartpos(obj) {
obj.deltay = Math.floor(Math.random() * 12);
obj.deltax = Math.floor(Math.random() * 12);
obj.xdir = (Math.floor(Math.random() * 2) == 1) ? '+' : '-';
obj.ydir = (Math.floor(Math.random() * 2) == 1) ? '+' : '-';
obj.counter = 1;
if (isNS) {
obj.clip.width = 1;
obj.clip.height = 1;
obj.moveTo(xoffset+pageXOffset, yoffset+pageYOffset);
} else {
obj.width = 1;
obj.height = 1;
obj.pixelTop = yoffset+document.body.scrollTop;
obj.pixelLeft = xoffset+document.body.scrollLeft;
}
}
function movestar(starN) {
tmpx = starN.deltax*starN.counter+starN.counter;
tmpy = starN.deltay*starN.counter+starN.counter;
if (isNS) {
starN.clip.width = starN.counter / 3;
starN.clip.height = starN.counter / 3;
scrlx = pageXOffset;
scrly = pageYOffset;
if ((starN.left+tmpx >= w_x+scrlx) || (starN.top+tmpy >= w_y+scrly) || (starN.left-tmpx <= scrlx) || (starN.top-tmpy <= scrly)) {
getstartpos(starN);
} else {
eval('starN.moveBy('+starN.xdir+tmpx+', '+starN.ydir+tmpy+')');
}
} else {
starN.width = starN.counter/3;
starN.height = starN.counter/3;
scrlx = document.body.scrollLeft;
scrly = document.body.scrollTop;
if ((starN.pixelLeft+tmpx >= w_x+scrlx)||(starN.pixelTop+tmpy >= w_y+scrly) || (starN.pixelLeft-tmpx <= scrlx)||(starN.pixelTop-tmpy <= scrly)) {
getstartpos(starN);
} else {
eval('starN.pixelTop'+starN.ydir+'=tmpy');
eval('starN.pixelLeft'+starN.xdir+'=tmpx');
}
}
starN.counter++;
}
function animate() {
for(i=1; i <= starnum; i++) {
movestar(eval('star'+i));
}
setTimeout('animate()', 100);
}
function findwindowparams() {
w_x = (isNS) ? window.innerWidth : document.body.clientWidth;
w_y = (isNS) ? window.innerHeight : document.body.clientHeight;
xoffset = w_x / 2;
yoffset = w_y / 2;
for (i = 1; i <= starnum; i++) {
getstartpos(eval('star'+i));
}
}
function resizeNS() {
setTimeout('document.location.reload()', 400);
}
(isNS) ? window.onresize = resizeNS : window.onresize = findwindowparams;
window.onload = new Function("findwindowparams(); animate();");
// End -->
</script>




<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<script LANGUAGE="Javascript">
<!-- Begin
for (i = 1; i <= starnum; i++) {
document.writeln('<div id="star'+i+'" class="star"></div>');
eval('var star'+i+'=document.'+_all+'star'+i+_style);
}
// End -->
</script>



中查找“星星从背景中飞出”更多相关内容

中查找“星星从背景中飞出”更多相关内容



上一篇:RGB颜色转换
下一篇:radio颜色选择器
最近更新 赞助商
·打开网页后定时显示大图片广告然后自动关闭09-11
·滚动条闪动的控制11-07
·打雷效果11-07
·简单实用调色板工具11-07
·鼠标放到一色块上后显示颜色的各种表达值..11-07
·自己选择背景色11-07
·页面上出现满天的星星,效果非常好看的11-07
·一个绝对经典的颜色选择器,保证你看了会..11-07
·radio颜色选择器11-07
·星星从背景中飞出11-07
·RGB颜色转换11-07

共有评论 0 条 网友评分 0分 查看所有评论


发表评论→ 学而不思则罔,思而不学则殆,请大胆发表你的见解。

输验证码:

您对此篇文章的评分:1分 2分 3分 4分 5分

  • 站内搜索
关键词

搜索方式

搜索范围

精确匹配
Baidu
网站首页 - 关于本站 - 网站地图 - 广告合作 - 站点声明 - RSS订阅 - 联系我们
Copyright © 2005 网海拾贝.[新ICP备05003216号]. All Rights Reserved .