打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
JS特效-气泡

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
Image0 = new Image();
Image0.src = "jsimg/images/bubble.gif";
Amount = 20;
Ymouse = -50;
Xmouse = -50;
Ypos = new Array();
Xpos = new Array();
Speed = new Array();
rate = new Array();
grow = new Array();
Step = new Array();
Cstep = new Array();
nsSize = new Array();
ns = (document.layers)?1:0;
(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt) {
Ymouse=(document.layers)?evnt.pageY-20:event.y-20;
Xmouse=(document.layers)?evnt.pageX:event.x;
}
(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
for (I = 0; I < Amount; I++) {
Ypos[I] = Ymouse;
Xpos[I] = Xmouse;
Speed[I] = Math.random()*4+1;
Cstep[I] = 0;
Step[I] = Math.random()*0.1+0.05;
grow[I] = 8;
nsSize[I] = Math.random()*15+5;
rate[I] = Math.random()*0.5+0.1;
}
if (ns) {
for (I = 0; I < Amount; I++) {
document.write("<LAYER NAME='sn"+I+"' LEFT=0 TOP=0><img src="+Image0.src+" name='N' width="+nsSize[I]+" height="+nsSize[I]+"></LAYER>");
    }
}
else {
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (I = 0; I < Amount; I++) {
document.write('<img id="si" src="'+Image0.src+'" style="position:absolute;top:0px;left:0px;filter:alpha(opacity=90)">');
}
document.write('</div></div>');
}
function MouseBubbles() {
var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop;
var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft;
for (I = 0; I < Amount; I++){
sy = Speed[I] * Math.sin(270 * Math.PI / 180);
sx = Speed[I] * Math.cos(Cstep[I] * 4);
Ypos[I] += sy;
Xpos[I] += sx;
if (Ypos[I] < -40) {
Ypos[I] = Ymouse;
Xpos[I] = Xmouse;
Speed[I] = Math.random() * 6 + 4;
grow[I] = 8;
nsSize[I] = Math.random() * 15 + 5;
}
if (ns) {
document.layers['sn'+I].left = Xpos[I] + wscrll;
document.layers['sn'+I].top = Ypos[I] + hscrll;
}
else {
si[I].style.pixelLeft = Xpos[I] + wscrll;
si[I].style.pixelTop = Ypos[I] + hscrll;
si[I].style.width = grow[I];
si[I].style.height = grow[I];
}
grow[I] += rate[I];
Cstep[I] += Step[I];
if (grow[I] > 24) grow[I] = 25;
}
setTimeout('MouseBubbles()', 10);
}
MouseBubbles();
//   End -->
</script>

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
页面游动吐泡小鱼——让你的网页靓起来!
网页中的七彩文字
带颜色渐变的鼠标文字跟随
鼠标后面跟一串字的代码
在网页中移动的文字和图片代码
文本飞舞特效文本飞舞特效
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服