Scrolling layers trouble

admin

Administrator
Staff member
Hi there,

I'm trying to write a script that will scroll a layer up and down the browser. The problem I have is adding a conditional limiter to stop the scrolling before the layer goes off the top of the browser. This is what I have so far and I doesen't seem to work.

var num = 0, timer;

function up() {
num++;
if (num==20){
window.clearTimeout(timer);
}
else if (document.all) test.style.top=parseInt (test.style.top) -1;
else if (document.layers) document.lyr.top -=1;
{timer = window.setTimeout ( "up()", 50);}
}
 
Back
Top