PDA

View Full Version : Help with Javacript Scroller!!



Sessomy
08-03-2009, 10:51 PM
Hi

I have a javascript scroller on my site which was added automatically by the web design progam Web Page Maker.

It works well..... but..... does anybody know how to make the scrolling faster on mousedown. Its painfully slow at the moment.

I dont know ANYTHING about javascripting really.

heres the code:

<div id="g_iFrame1div" style="position:absolute; left:68px; top:273px; z-index:29">
<table border="0" cellpadding="0" cellspacing="0" width=628>
<tr><td>
<iframe src="iframes/news_latest.htm" name="g_iFrame1" width="606" height="487" src="" scrolling="no" frameborder="0"></iframe>

</td><td align="center" valign="middle" width="22"><img src="arrow_up.gif" alt="up" border=0 vspace="5" hspace="3"
onMouseDown="esh_g_iFrame1();bsh_g_iFrame1(-3,2)"
onMouseUp="esh_g_iFrame1();bsh_g_iFrame1(-1,20)"
onMouseOver="bsh_g_iFrame1(-1,20)"
onMouseOut="esh_g_iFrame1()"><br>
<img src="arrow_down.gif" alt="down" border=0 vspace="5" hspace="3"
onMouseDown="esh_g_iFrame1();bsh_g_iFrame1(3,2)"
onMouseUp="esh_g_iFrame1();bsh_g_iFrame1(1,20)"
onMouseOver="bsh_g_iFrame1(1,20)"
onMouseOut="esh_g_iFrame1()">

<script type="text/javascript" language="javascript">
function bsh_g_iFrame1(step,time){hs_g_iFrame1=setInterval("sh_g_iFrame1("+step+")",time)}
function esh_g_iFrame1(){clearInterval(hs_g_iFrame1)}
function sh_g_iFrame1(step)
{
scrollx=g_iFrame1.document.body.scrollLeft
scrolly=g_iFrame1.document.body.scrollTop
scrolly=scrolly+step
g_iFrame1.window.scroll(scrollx,scrolly)
}
</script>

thanks

Stuey