[Bats!]

Fleder- Mauszeiger :-))

[zwischen <HEAD> und </HEAD>]

<script language="JavaScript">
<!-- bats script by kurt.grigg@virgin.net // modified by N8i (www.nightfire.ch)

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var mozup = (!document.all && document.getElementById) ? 1 : 0;

amount=5; //minimum must be 3 !!

function pRe(){
Img0=new Image();
Img0.src="bat1.gif";
Img1=new Image();
Img1.src="bat2.gif";
Img2=new Image();
Img2.src="bat3.gif";
setTimeout('pRe()',3000)
}

// brwsr=(document.layers)?1:0;

if (ns4up){
window.captureEvents(Event.MOUSEMOVE);
for (i=0; i < amount; i++)
document.write("<LAYER NAME=n"+i+" LEFT=0 TOP=-50><IMG SRC='bat1.gif' NAME='nsi'></LAYER>");
}
else{
document.write('<div id="ie" style="position:absolute;top:0;left:0"><div style="position:relative">');
for (i=0; i < amount; i++)
{document.write('<img name="msieBats" src="bat1.gif" style="position:absolute;top:-50;left:0">')}
document.write('</div></div>');
}

bats=new Array('bat1.gif','bat2.gif','bat3.gif','bat2.gif')

Xpos=0;
Ypos=-50;
yBase=0;
xBase=0;
step=0.5;
currStep=0;
a_count=0;
b_count=1;
c_count=2;
move=1;

function handlerMM(e) {
Xpos = (ns4up || mozup) ? e.pageX : document.body.scrollLeft+event.clientX
Ypos = (ns4up || mozup) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}


if (ns4up){
window.onMouseMove = handlerMM;
}
else{
document.onmousemove = handlerMM;
}


function Swirl(){
if (!ns4up && !mozup)ie.style.top=document.body.scrollTop;
yBase=(document.layers)?window.innerHeight/3:window.document.body.offsetHeight/3;
xBase=(document.layers)?window.innerWidth/7:window.document.body.offsetWidth/7;
for (i=0; i < amount; i++){
var layer=(document.layers)?document.layers["n"+i]:msieBats[i].style;
layer.top = Ypos+yBase*Math.sin(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/20)
layer.left =Xpos+xBase*Math.cos(((currStep)+i*3.7)/4)*Math.cos((currStep+i*35)/62)
}
currStep+=step;
}

function Animate(){
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 (ns4up){
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[c_count];
}
else{
msieBats[0].src=bats[a_count];
msieBats[1].src=bats[b_count];
msieBats[2].src=bats[c_count];
}
if (amount > 2)
{
for (i=3; i < amount; i++)
{
if (ns4up)
document.layers['n'+i].document.images['nsi'].src=bats[b_count];
else
msieBats[i].src=bats[b_count];
}
}
a_count+=move;
b_count+=move;
c_count+=move;
Swirl();
setTimeout('Animate()',30)
}
//-->

</script>

[in den BODY- Tag]

onLoad="pRe();Animate()"

[Autor]


Kurt Grigg
modified by N8i (www.nightfire.ch)

[Download]


zurück

Copyright © 1998- Nightfire Webworker Archiv Script No: 0005