Results 1 to 9 of 9

Thread: manual scroller with scroll bar

  1. #1
    Join Date
    Mar 2005
    Location
    kent, england
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default manual scroller with scroll bar

    I'm trying to get the manual scroller script to work alongside a visible scrollbar but the bar does not function properly when moving content up and down. You can see what i mean here:

    http://www.mrpdev.co.uk/scrolltest.htm

    Anyone got any ideas?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I thought this couldn't be done until I was looking into another scrolled content question and it more or less happened. Now with some refinemets, it is a two page solution using an iframe, here is the iframe page:

    HTML Code:
    <html>
    <head>
    <title>Manual Scroller w/scrollbar - Demo</title>
    <script type="text/javascript">
    var holder,scrollspeed
    </script>
    <style type="text/css">
    span.cntrl {
    cursor:hand;
    cursor:pointer;
    color:blue;
    text-decoration:underline
    }
    </style>
    </head>
    <body>
    <!--Scrollable iframe script- By Dynamic Drive-->
    <!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
    <!--Highly modified here-->
    <!--This credit MUST stay intact for use-->
    
    <layer visibility=hide>
    <div style="width:200px;margin-bottom:3px;text-align:center;cursor:default">
    <span class="cntrl" onClick="scrollspeed=1">Down</span> <b>|</b> <span class="cntrl" onClick="scrollspeed=-1">Up</span> <b>|</b> <span class="cntrl" onClick="scrollspeed=0">Stop</span> <b>|</b> <span class="cntrl" onClick="scrollspeed=0;window['datamain'].location.replace('external.htm')">Top</span>
    </div>
    </layer>
    <iframe onMouseOver="holder=scrollspeed;scrollspeed=0" onMouseOut="scrollspeed=holder" id="datamain" width=200 height=150 src="external.htm"></iframe>
    </body>
    </html>
    and here is the external.htm file used by it:

    HTML Code:
    <!-- external.htm source-->
    <html>
    <body>
    
    
    <div>
    <!-- ADD YOUR SCROLLER CONTENT INSIDE HERE -->
    
    <b>What's Hot</b></p>
    <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
    code encrypter</a>&nbsp;</small></font></strong><br>
    <font face="Verdana" size="2">Scramble the source of any chunk of code using
    this unique script.</font></p>
    <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
    links</a>&nbsp;</small></font></strong><br>
    <font face="Verdana"><small>Bring attention to special links, by making them
    flash!</small></font></p>
    <p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
    Cursor</a>&nbsp;</font></strong></small><br>
    <small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
    page with this fun animation script.</font></small></p>
    <p align="left"><font face="Verdana"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated
    Document title</small></a><br>
    </strong><small>Animate into view your document's title!</small></font>
    
    <!-- END SCROLLER CONTENT -->
    
    </div>
    
    <!--DO NOT REMOVE BELOW SCRIPT. IT SHOULD ALWAYS APPEAR AT THE VERY END OF YOUR CONTENT-->
    
    <script type="text/javascript">
    
    //Scrollable content III- By http://www.dynamicdrive.com
    //Modified here
    
    var speed
    
    function initialize(){
    if (window.parent.scrollspeed!=0){
    speed=window.parent.scrollspeed
    scrollwindow()
    }
    }
    
    function scrollwindow(){
    window.scrollBy(0,speed)
    }
    
    setInterval("initialize()",10)
    
    </script>
    
    </body>
    </html>
    Some behaviors of these two pages will be easy to modify others will take more work, if you need a modification and can't figure it out, let me know.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    How can i make the scroller move up or down on start and without the user clicking
    up or down? Also how can add the auto pause?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Put this on the top (the one with the iframe on it) page:
    Code:
    <body onload="scrollspeed=1">
    It already pauses onmouseover of the scrolling content. What did you mean by auto pause?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    Put this on the top (the one with the iframe on it) page:
    Code:
    <body onload="scrollspeed=1">
    It already pauses onmouseover of the scrolling content. What did you mean by auto pause?
    I actually don't need the IFRAME page. I just wanted to enable auto scroll
    and the pause onMouseover in the manualscroll script.

    http://www.dynamicdrive.com/dynamici...nualscroll.htm

    Thanks. I will implement the IFrame for something else now that i can make it autoscroll.

  6. #6
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    Put this on the top (the one with the iframe on it) page:
    Code:
    <body onload="scrollspeed=1">
    It already pauses onmouseover of the scrolling content. What did you mean by auto pause?
    Is there a way to make it loop as well as control teh scrollspeed?

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Sounds like you want a vertical marquee, am I right? If so, check out this demo. You can make it take up the entire page if that is what you wish.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Cool.
    Thanks

  9. #9
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can you make this thing loop?

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
  •