Advanced Search

Results 1 to 3 of 3

Thread: Scrolling continues after dragging off the button.

  1. #1
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Scrolling continues after dragging off the button.

    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()
    {
    parent.left_frm.scrollBy(0,-100);
    scrolldelay = setTimeout('scrollUp()',250);
    }
    function scrollDown()
    {
    parent.left_frm.scrollBy(0,100);
    scrolldelay = setTimeout('scrollDown()',250);
    }
    function doNothing()
    {
    }
    //-->
    </script>
    </HEAD>
    <LINK href="tsk.css" type=text/css rel="STYLESHEET">
    <BODY BGCOLOR=#ffffff>
    <Form>
    <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>

    <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 />
    </tr>
    </table>
    </form>
    </BODY></HTML>

  2. #2
    Join Date
    Sep 2004
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try putting in:

    Code:
    onClick="doNothing()"

  3. #3
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    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.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •