首页产品库评测行情新闻|手机数码笔记本台式机DIY硬件数字家庭数码相机办公外设|软件下载游戏开发|社区

更多

数码相机
MP4
LCD
机箱
音箱

软件资讯设计 工具 系统 开发 安全 办公 陶吧 IT教育 Vista频道 | 下载中心酷我音乐盒 腾讯QQ MSN安全版
天极网 > 软件频道 > 网页陶吧 >网页特效:一个在页面上蠕动的怪圈

网页特效:一个在页面上蠕动的怪圈

2006-04-05 09:22作者:龙犊整理出处:天极网责任编辑:龙犊


<!-- 要实现此效果需要 2 个步骤: -->

<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->

<BODY bgcolor=#000000>



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

<script language=JavaScript>

if (document.all){
with (document){
write('<div id="starsDiv" style="position:absolute;top:0px;left:0px">')
str = '<div style="position:relative;width:XXpx;height:XXpx;background:#ffffff;font-size:XXpx;visibility:visible"></div>'
re = /XX/g;// 创建正则表达式模式?
str1=str.replace(re,"1")
str2=str.replace(re,"2")
str3=str.replace(re,"3")
for (j=0;j<2;j++)
{
for (i=0;i<14;i++)
write(str1)

for (i=0;i<9;i++)
write(str2)
}
write(str3)
write('</div>')
}
}

if (document.layers)

var yBase = 10;
var xBase = 10;
var step = 0.5;
var currStep = 0;
var Xpos = 520;
var Ypos = 250;

if (document.all)
{
function MoveHandler(){
Xpos = document.body.scrollLeft+event.x;
Ypos = document.body.scrollTop+event.y;
}
;
}

else if (document.layers)
{
function xMoveHandler(evnt){
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = xMoveHandler;
}

function animateLogo() {
if (document.all)
{
yBase = window.document.body.offsetHeight/6;
xBase = window.document.body.offsetWidth/6;
}
else if (document.layers)
{
yBase = window.innerHeight/8;
xBase = window.innerWidth/8;
}

if (document.all)
{
for ( i = 0 ; i < starsDiv.all.length ; i++ )
{
starsDiv.all[i].style.top = Ypos + yBase*Math.sin((currStep + i*4)/12)*Math.cos(400+currStep/200);
starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(currStep/200);
}
}

else if (document.layers)
{
for ( j = 0 ; j < 14 ; j++ ) //number of NS layers!
{
var templayer="a"+j
document.layers[templayer].top = Ypos + yBase*Math.sin((currStep + j*4)/12)*Math.cos(400+currStep/200);
document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(currStep/200);
}
}
currStep+= step;
setTimeout("animateLogo()", 10);
}
animateLogo();
</script>

关注此文的读者还看过:

返回软件频道首页

软件频道最新更新

热点推荐

IT嘉年华

编辑推荐

热门
推荐

网友关注

软件
资料
游戏

装机推荐

文章排行

本周
本月
最新更新

软件资讯

操作系统 | 设计在线 | 工具软件
IT教育  | 开发频道 | 网络安全
办公软件 | 网页陶吧 | 资讯中心
产品中心 | 每周周刊 |
 有道词典 QQ直播   |  酷狗音乐 Winamp | QQ MSN
 暴风影音美图秀秀 | 搜狗拼音 | Winrar | 迅雷 | Skype
 金山毒霸 |  光影魔术  | FoxmailPPfilm | WMP | PPS  
 瑞星杀毒酷我音乐  | PPLiveFirefox傲游 | 快车
群乐:Office | QQ  | MSN | QQ空间代码 | 你问我答 | 工具 | 壁纸大全 | 系统软件 | 防毒杀毒PS菜鸟园地 | 黑客 | 照片后期处理 | 开发PC靓化 | Vista | WPS | Windows 7 | Windows XP | Linux | Excel | Word | Powerpoint | Photoshop | Outlook | Flash设计秀场
天极服务| 关于我们| About us| 网站律师| 电子杂志| RSS订阅| 友情合作| 加入我们| 网站地图| MSN/QQ上看天极
TMG
Copyright (C) 1999-2009 Yesky.com, All Rights Reserved
版权所有 天极网络
商务联系、网站内容、合作建议:010-82657868 023-63659988在线提交意见反馈
渝ICP证B2-20030003号  通用网址:天极网
天极传媒:天极网|比特网|IT专家网|52PK游戏网|IT分众
经营性网站备案信息 网警备案 中国网站排名