View Full Version : Scrolling continues after dragging off the button.

Anthony Mac Egan
12-13-2006, 01:22 PM
Hi guys,
I am new to java script so I hop I will be more of a help to the forum in the future.
I have a page divided into two frames. For the purpose of a touh screen.
Their is the main page and a side control bar with some links and scroll up and down arrow buttons.
It all works fine unless I hold down the button and drag my finger away to a neutral area. - The page just keeps scrolling untill it reaches the bottom or until I hit another button.
I know its not mission critical an could even be disgised as a feature but I would just like to see it solved.
Hope you can make sense of my code. I deleted anything not of use.
Thanks Anthony.

<script language="javascript">
function scrollUp()
scrolldelay = setTimeout('scrollUp()',250);
function scrollDown()
scrolldelay = setTimeout('scrollDown()',250);
function doNothing()
<LINK href="tsk.css" type=text/css rel="STYLESHEET">
<BODY BGCOLOR=#ffffff>
<table border=0 HEIGHT=100% ALIGN='CENTER'>
<tr valign=top>
<td align=left>
<input type="image" src="../images/UpArrow.gif" name="btnup1" onMouseOver="doNothing()" onMouseDown="scrollUp()" onMouseUp="doNothing()" onMouseOut="doNothing()" onDrag="doNothing()"><br /><br />

<tr valign=bottom>
<td align=left>
<input type="image" src="../images/DownArrow.gif" align=center name="btnDown1" onMouseOver="doNothing()" onMouseDown="scrollDown()" onMouseUp="doNothing()" onMouseOut="" onDrag="doNothing()"><br /><br />

Arctic Fox
12-20-2006, 04:11 AM
Try putting in:


12-20-2006, 09:24 AM
Seems to me the code is sound, but then again, it doesn't appear to have any "touch screen" differences. If this were on a web page on a normal monitor I wouldn't be able to drag the scroll bar.

If a touch screen reacts different to the coding (as it appears) perhaps you could put in something such as an x/y for the scroll bar and if x or y >= certain number then go to donothing();

Or creates an if drag go to donothing(); and swap to starting x/y??

Not sure of touch screen application nuances. :confused: