Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Overflow-y

  1. #1
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts

    Overflow-y

    I'm creating a site just made in css and divs, I have overflow-y:scroll which makes the div scrollable in IE, but how can I do this for NS/Mozilla? The text is just going down the page.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Netherlands
    Posts
    217
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Use this simple script:
    Code:
    <script>
    document.getElementById("div_id").style.overflow="hidden";
    document.getElementById("div_id").style.overflow="-moz-scrollbars-vertical";
    </script>
    Where "div_id" is the ID of your DIV tag.

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Thanks

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Just modified it a little as it was throwing an error in IE5, incase anyone else wants it

    if(document.all){
    document.getElementById("content1").style.overflow="auto";
    }else{
    document.getElementById("content1").style.overflow="-moz-scrollbars-vertical";
    }


  •  

    Posting Permissions

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