PDA

View Full Version : old Netscape code



Eepē
06-16-2007, 10:54 AM
How do I make this animated layer code work in Firefox and IE? Thanks.


<layer name=a left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,1,1></layer>
<layer name=b left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,2,1></layer>
<layer name=c left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,3,1></layer>
<layer name=d left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,4,1></layer>
<layer name=e left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,5,1></layer>
<layer name=f left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,6,1></layer>
<layer name=g left=0 top=0 visibility=show bgcolor=#626e76 clip=0,0,7,1></layer>

<script language=javascript>
var ns=document.layers ? 1 : 0;
if (ns) {
window.PrxOff_captureEvents(Event.MOUSEMOVE);
var yBase = .5;
var xBase = .1;
var delay = 10;
var yAmpl = 0;
var yMax = 0;
var step = .1;
var ystep = 0;
var currStep = 0;
var tAmpl=.1;
var Xpos = 100;
var Ypos = 325;
var j = 0;
function MoveHandler(evnt) {
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = MoveHandler;
function animateLogo() {
yBase = window.innerHeight/2;
xBase = window.innerWidth/2;
for (j=0; j<7 ;j++) {
document.layers[j].top = Ypos + Math.cos((Math.sin(currStep/10)))*yBase*(Math.cos(currStep/10))*Math.sin((currStep/1 + j*50));
<!-- document.layers[j].left =Xpos + Math.sin((20*Math.sin(currStep/20)))*xBase*(Math.cos(currStep/10))*Math.sin((currStep)/10);-->
}
currStep += step;
setTimeout("animateLogo()", delay);
}
animateLogo();
}
</script>