Scroll virker ikke i FireFox
Hej,På www.mountfield.dk/realtime har jeg implementeret en funktion til at scrolle en div. Denne er vist herunder:
function scrollayer(layername,amt,tim)
{
thelayer = getElement(layername);
if (!thelayer) return;
amount = amt;
theTime = tim;
realscroll();
}
function realscroll()
{
clipTop += amount;
clipBottom += amount;
topper -= amount;
if (clipTop < 0 || clipBottom > lyrheight)
{
clipTop -= amount;
clipBottom -= amount;
topper += amount;
return;
}
if (document.getElementById || document.all)
{
clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
thelayer.style.clip = clipstring;
thelayer.style.top = topper;
}
else if (document.layers)
{
thelayer.style.clip.top = clipTop;
thelayer.style.clip.bottom = clipBottom;
thelayer.style.top = topper;
}
time = setTimeout('realscroll()',theTime);
}
function stopScroll()
{
if (time) clearTimeout(time);
}
Desværre virker det ikke for FireFox.
Mvh, Steven