SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Scroll bars

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scroll bars

    I've got 2 divs, leftContent and rightContent.

    Both are within a div called mainContent:

    <div id="mainContent">
    <div id="leftContent">

    <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About Us</a></li>
    <li><a href="#">Services</a></li>
    <li><a href="#">How it Works</a></li>
    <li><a href="#">Contact Us</a></li>
    </ul>

    <!--end #leftContent--></div>
    <div id="rightContent">

    <p>content here</p>

    <!--end #rightContent--></div>
    <!-- end #mainContent --></div>
    Each div is floated left and right respectively.

    How can I get the right hand div to scroll, but not the left div or the #mainContent/body?

    Is this possible? It would be the icing on my first webpage!

    Cheers,

    nick.


    **edit:

    ha - just worked it out: with the overflow: auto property....... is it possible to create my own scroll bars? the browser ones look **** :P

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by j3ff3 View Post
    is it possible to create my own scroll bars? the browser ones look **** :P
    There is proprietary CSS that can be used to change the colour of the scrollbars in IE and Opera provided that the browser owner hasn't turned it off. To do anything that would work in all browsers would mean using JavaScript to hide the browser generated scrollbar and insert your own JavaScript generated one in its place.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •