• 文字广告位
  • 文字广告位
  • 文字广告位
您现在的位置: 站长手册 >> 特效代码 >> 窗口类 >> 正文
站内搜索
Google
[图文]飞舞的蝙蝠
          ★★★   

飞舞的蝙蝠

雅虎收藏夹 百度收藏 Google书签 Yahoo书签 新浪ViVi 搜狐网摘 365Key网摘 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 Del.icio.us digg reddit spurl BlinkList blogmarks
人气: 来源:本站原创 作者:佚名 所属栏目:窗口类 [切换到繁體中文]
介绍:一群蝙蝠在屏幕中飞舞,类似全面的天使特效。

演示:

[Ctrl+A全选 提示:你可先修改部分代码,再按运行]

下面教你如何应用此特效:
 --------------------------------------------------------------------------------------
  需要在<body 这里>加入的代码:
 --------------------------------------------------------------------------------------
以下代码加到<head>…</head>中
以下代码加到<body>…</body>中
<script language="JavaScript1.2">
<!--
ImgA=new Image();
ImgA.src="/texiao/zzsc_demo/bat1.gif";
ImgB=new Image();
ImgB.src="/texiao/zzsc_demo/bat2.gif";
ImgC=new Image();
ImgC.src="/texiao/zzsc_demo/bat3.gif";
ImgD=new Image();
ImgD.src="/texiao/zzsc_demo/bat4.gif";
//-->
</script>
<script language="JavaScript1.2">
<!--
amount=6;
Xpos=300;
Ypos=200;
step=0.5;
dismissafter=100;

bats=new Array(ImgA.src,ImgB.src,ImgC.src,ImgD.src)
if (document.layers){
for (I=0; I < amount; I++)
{document.write("<LAYER NAME=n"+I+" LEFT=0 TOP=-50><IMG SRC='bat1.gif' NAME='nsi'></LAYER>")}
}
if (document.all)
{
document.write('<div id="out" style="position:absolute;top:0;left:0"><div id="in" style="position:relative">');
for (I=0; I < amount; I++)
{document.write('<img src="bat1.gif" id="msieBats"'+I+'  style="position:absolute;top:-50;left:0">')}
document.write('</div></div>');
}

yBase=0;
xBase=0;
currStep=0;
a_count=0;
b_count=1;
c_count=2;
d_count=3;
move=1;
if (document.layers){
yBase=window.innerHeight/3;
xBase=window.innerWidth/6;
window.captureEvents(Event.MOUSEMOVE);

}
if (document.all){
yBase = window.document.body.offsetHeight/3;
xBase = window.document.body.offsetWidth/6;
}

function dismissbat(){
clearInterval(flybat)
if (document.layers){
for (i2=0; i2 < amount; i2++){
document.layers['n'+i2].visibility="hide"
}
}
else if (document.all)
document.all.out.style.visibility="hidden"
}

function Animate(){
a_count+=move;
b_count+=move;
c_count+=move;
d_count+=move;
currStep+=step;
if (a_count >= bats.length) a_count=0;
if (b_count >= bats.length) b_count=0;
if (c_count >= bats.length) c_count=0;
if (d_count >= bats.length) d_count=0;
if (document.layers){
document.layers['n'+0].document.images['nsi'].src=bats[a_count];
document.layers['n'+1].document.images['nsi'].src=bats[b_count];
document.layers['n'+2].document.images['nsi'].src=bats[b_count];
if (amount > 2)
 {
 for (I=3; I < amount; I++)
  {document.layers['n'+I].document.images['nsi'].src=bats[d_count]}
 }
for (I=0; I < amount; I++)
 {
  var NewL="n"+I
  document.layers[NewL].top = Ypos+yBase*Math.sin(((currStep)+I*3.7)/4)*Math.cos((currStep+I*35)/10)
  document.layers[NewL].left =Xpos+xBase*Math.cos(((currStep)+I*3.7)/4)*Math.cos((currStep+I*35)/62)
  }
}
if (document.all){
document.all.msieBats[0].src=bats[a_count];
document.all.msieBats[1].src=bats[b_count];
document.all.msieBats[2].src=bats[c_count];
if (amount > 2)
 {
 for (I=3; I < amount; I++)
  {document.all.msieBats[I].src=bats[d_count]}
 }
for (I=0; I < amount; I++)
 {
  document.all.msieBats[I].style.pixelTop = Ypos+yBase*Math.sin(((currStep)+I*3.7)/4)*Math.cos((currStep+I*35)/10)
  document.all.msieBats[I].style.pixelLeft =Xpos+xBase*Math.cos(((currStep)+I*3.7)/4)*Math.cos((currStep+I*35)/62)
 }
}
}
flybat=setInterval('Animate()',30);
setTimeout("dismissbat()",dismissafter*1000)
//-->
</script>

  • 下一个特效:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    姓 名: *(必填项) ·注册用户·
    Email: QQ号:
    评 分: 1分 2分 3分 4分 5分
    • 您可以发表评论支持你喜欢的文章。
    • 请遵守《互联网电子公告服务管理规定》
    • 请遵守中华人民共和国各项有关法律法规。
    • 严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
    • 评论人需对自己在使用评论过程中的行为承担法律责任。
    • 本站管理员有权保留或删除评论内容。
    • 评论内容只代表个人观点,与本网站立场无关。
    站内特效搜索
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | | 京ICP备 05004866号 |
    版权所有 2007-2008 站长手册 WWW.ZZSC.ORG 业务联系 zzsc.org#gmail.com