Results 1 to 6 of 6

Thread: Help with scrollable content script

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

    Default Help with scrollable content script

    1) Script Title: Scrollable Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex11/scrollc.htm

    3) Describe problem: Is there any way to have this script place the scrollbar on the left of the text instead of the right? Thanks for any help!

    Bob

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Whoa... I just figured out a way to do this..

    Code:
    <html>
    <head>
    <script>
    function scroll() {
    scroller.scrollTop=left.scrollTop
    }
    </script>
    </head>
    <body>
    <div id="left" style="color:white;position:absolute;left:-70;overflow-y:scroll;overflow-x:hidden;scroll;width:100px;height:100px" onscroll="scroll()">
    This is a cool script that allows you to compact any content and confine it within a scrollable mini "window" Save
    valuable document space while making your page more "interactive", all at the same time! This script uses two
    different techniques- one for IE, one for NS- to create the scrollable window. Scrollbars will be available to 
    IE 4 users to scroll the window, while NS users will need to use the "up" and "down" buttons instead (since NS
    does not support the adding of scrollbars to contents). 
    </div>
    <div id="scroller" style="padding:2px;border:1px solid gray;overflow:hidden;width:100px;height:100px;margin-left:20">
    This is a cool script that allows you to compact any content and confine it within a scrollable mini "window" Save
    valuable document space while making your page more "interactive", all at the same time! This script uses two
    different techniques- one for IE, one for NS- to create the scrollable window. Scrollbars will be available to 
    IE 4 users to scroll the window, while NS users will need to use the "up" and "down" buttons instead (since NS
    does not support the adding of scrollbars to contents). 
    </div>
    </body>
    </html>
    - Mike

  3. #3
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Mike,

    Thanks for the reply! This seems to work fine for the exact code you provided, but I can not figure out how to modify it. For example, if I wanted the window to be 500px wide instead of 100, I tried changing the width:100px to width:500px, but that did not work. Also, it seems like you have to enter your content twice - in both divs? Thanks for any clarification - appreciate the help.

    Bob

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I have the content in both divs so the left div will have the same scoll height as the scroller div. When you edit the height, edit both divs, same with width.
    - Mike

  5. #5
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    The script isn't actually moving the scrollbar to the left, it's just creating another div, to the left of the actual div.

    This may seem a little confusing, so feel free to ask questions
    - Mike

  6. #6
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Mike,

    When I tried to edit the width, I did edit the width in both divs, but it did not work. I tried changing both widths to 500. Here is what it looks like when doing that:


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
  •