Results 1 to 4 of 4

Thread: scroll mouse up/down

  1. #1
    Join Date
    Oct 2009
    Location
    Az
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default scroll mouse up/down

    I have an iframe, I would like two image buttons on the outside of the frame (an up arrow and a down arrow) to scroll my iframe onmousedown and stop onmouseup

    Can someone please help me with this?
    btw this is targeted at older browsers like netscape 4 and IE 5

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    In javascript use the 'scrollTop' and 'scrollLeft'
    Here's an example (I do not recommend using it though):
    Jeremy | jfein.net

  3. #3
    Join Date
    Oct 2009
    Location
    Az
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Here I have two buttons
    Only the one at the bottom works
    I need the top one to scroll down and the bottom one to do the reverse



    Code:
    <head>
    <script>
    
    function stopScroll() {
        	clearTimeout(scrolldelay);
    }
    
    </script>
    <script>
    
    }
    
    
    function pageScroll() {
        	window.scrollBy(0,80); // horizontal and vertical scroll increments
        	scrolldelay = setTimeout('pageScroll(3)',100); // scrolls every 100 milliseconds
    
    </script>
    
    
    <script>
    function pageScroll() {
        	window.scrollBy(0,-80); // horizontal and vertical scroll increments
        	scrolldelay = setTimeout('pageScroll(2)',100); // scrolls every 100 milliseconds
    }
    
    
    </script>
    </head>
    <input type="button" onClick="pageScroll(3)" value="Scroll Page">
    
    <a href="javascript:stopScroll()">Stop Scrolling</a>
    
    
    <BR><BR><BR><BR><BR><BR><BR><BR>
    <H1>test</H1>
    <BR><BR><BR><BR><BR><BR><BR><BR>
    test
    <BR><BR><BR><BR><BR><BR><BR><BR>
    test
    
    
    
    
    <BR><BR><BR><BR><BR><BR><BR><BR>
    <H1>test</H1>
    <BR><BR><BR><BR><BR><BR><BR><BR>
    test
    <BR><BR><BR><BR><BR><BR><BR><BR>
    test
    
    <a href="javascript:stopScroll()">Stop Scrolling</a>
    
    
    <input type="button" onClick="pageScroll(2)" value="Scroll Page">

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Hmm... they both work for me?
    Jeremy | jfein.net

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
  •