I would like to create two links which act as a scroll-up and scroll-down commands for a div. At the moment this is what i tried:
HTML
<div id="scroll">
<a href=# onmouseover="javascript:scroll(tekst, -50)" onmouseout="stopscroll()" ><img src="images/p_gor.png" /></a>
<a href=# onmouseover="javascript:scroll(tekst, 50)" onmouseout="stopscroll()" ><img src="images/p_dol.png"/></a>
JavaScript
function scroll(objekt, kol){
objekt.scrollBy(0,kol);
scrollDelay = setTimeout('scroll', 100);
}
function stopScroll(){
clearTimeout(scrollDelay);
}
but i dont know how to reference a div as an object to be scrolled. I tried calling it by using a CSS id and giving it a name but nothing worked.
Any suggestions?