欢迎光临
我们一直在努力

dhtml:围着鼠标转的小鸟(飞鸟:不是我)

建站超值云服务器,限时71元/月

来几段有趣的dhtml,挺好玩的,是做五子棋的时候找来的副产品
咪咪今年有多大了?去过这么多地方,看上去好象比飞哥哥还要大一些似的。
图片我就懒得传了,本来我是用的那个拍翅膀的小天使。
现在只支持netscape 4,赶明儿把ie的做出来。是一个围着鼠标转的小鸟。
<html>
<head>
<title>飞鸟</title>
</head>

<body bgcolor="#505050" text="#ffffff" link="#e0e0e0" vlink="#808080" alink="#ffffff" >
<layer name="a" left="10" top="10" visibility="show" bgcolor="#fffae2" clip="0,0,50,50" >
<img src="flybird.gif"></layer >

<script language="javascript1.2" >
// <!–
var useragent = navigator.appname + " " + navigator.appversion;
var agentinfo = useragent.substring(0, 12);

if (agentinfo >= "netscape 4.0") {
window.captureevents(event.mousemove);
var ybase = window.innerheight/2;
var xbase = window.innerwidth/2;
var delay = 20;
var yampl = 10;
var ymax = 40;
var step = .2;
var ystep = .5;
var currstep = 0;
var tampl=1;
var xpos = 10;
var ypos = 10;
var j = 0;

function movehandler(evnt) {
xpos = evnt.pagex ;
ypos = evnt.pagey ;
}
window.onmousemove = movehandler;
function flybird() {
ybase = window.innerheight / 4;
xbase = window.innerwidth / 4;

document.layers[0].top = ypos + math.cos( ( 20 * math.sin( currstep / ( 20 + j ) ) ) + j * 70 ) * ybase * (math.sin( 10 + currstep / 10 ) + 0.2 ) * math.cos( ( currstep + j * 25 ) / 10);

document.layers[0].left =xpos + math.sin( ( 20 * math.sin( currstep / 20 ) ) + j * 70 ) * xbase * (math.sin( 10 + currstep / (10 + j ) ) + 0.2 ) * math.cos( (currstep + j * 25 ) / 10);

currstep += step;
settimeout("flybird()", delay) ;
}

flybird()
}
// — >
</script >
</body > </html >  

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » dhtml:围着鼠标转的小鸟(飞鸟:不是我)
分享到: 更多 (0)

相关推荐

  • 暂无文章