home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Internet 2000 May
/
MICD_2000_05.iso
/
Www
/
Zajaczek
/
motyle.js
< prev
next >
Wrap
Text File
|
2000-03-23
|
2KB
|
51 lines
<!-- Original: freeware.de --><!-- Web Site: http://freeware.de --><!-- This script and many more are available free online at --><!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var ns=document.layers ? 1 : 0;
if (ns) {
document.writeln('<P><LAYER NAME="a" LEFT=20 TOP=20 VISIBILITY=SHOW background="img/st1.gif" CLIP="0,0,30,30"></LAYER>');
document.writeln('<LAYER NAME="b" LEFT=30 TOP=30 VISIBILITY=SHOW background="img/st1.gif" CLIP="0,0,30,30"></LAYER>');
document.writeln('<LAYER NAME="c" LEFT=40 TOP=40 VISIBILITY=SHOW background="img/anipix1.gif" CLIP="0,0,50,50"></LAYER>');
document.writeln('<LAYER NAME="d" LEFT=50 TOP=50 VISIBILITY=SHOW background="img/anipix2.gif" CLIP="0,0,70,80"></LAYER>');
document.writeln('<LAYER NAME="e" LEFT=60 TOP=60 VISIBILITY=SHOW background="img/anipix3.gif" CLIP="0,0,60,85"></LAYER></P>');
window.captureEvents(Event.MOUSEMOVE);
var yBase = 200;
var xBase = 200;
var delay = 10;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 50;
var Ypos = 50;
var j = 0;
function MoveHandler(evnt) {
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = MoveHandler;
function animateLogo() {
yBase = window.innerHeight/4 ;
xBase = window.innerWidth/4;
for ( j = 0 ; j < 5 ; j++ ) {
document.layers[j].top = Ypos +
Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*
(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
document.layers[j].left =Xpos +
Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*
(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
}
currStep += step;
setTimeout("animateLogo()", delay);
}
animateLogo();
}
// End -->