Entry
How to make scrollbars that handle javascript? i.e. when I scroll, scripts run and update web page
Jan 4th, 2003 06:18
Klaus Bolwin, Andrew,
In Mozilla you can use the onscroll event handler:
function LayerPos(Ereignis)
{
ypos = pageYOffset;
test(-ypos/2)
}
function test(y)
{
document.body.style.backgroundPosition=y+'px';
document.body.style.color = "rgb(0,"+(-y/2)+","+(-y)+")";
}
document.onscroll = LayerPos;
In MSIE the event handler is:
window.onscroll = LayerPos;
window.onscroll is also working in Mozilla, but document.onscroll isn't
in MSIE.