overflow: scroll; Help!

Discussion in 'HTML & Website Design' started by wd_2k6, Jul 19, 2008.

  1. #1
    Hi,

    I have a DIV with dynamic text in, set to Overflow: scroll and Max height of 200px;

    OK firstly how can i get rid of the default VERTICAL greyed out scrollbar, which there is obviously no use for, as users will never be able to scroll vertically?

    Secondly can I change the horizontal scrollbar in any way from the default grey one to a better looking one, maybe my own styled one? The grey one simply doesn't cut it!

    Many Thanks
     
    wd_2k6, Jul 19, 2008 IP
  2. faithnomoread

    faithnomoread Peon

    Messages:
    174
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Heres for the second part:
    ucan name it anything u want
    .divscroll {
    scrollbar-base-color: #663366;
    scrollbar-face-color: #99CCCC;
    scrollbar-track-color: #996699;
    scrollbar-arrow-color: #330033;
    scrollbar-highlight-color: #FFFFFF;
    scrollbar-3dlight-color: #CCCCCC;
    scrollbar-shadow-color: #663366;
    scrollbar-darkshadow-color: #000000;
    }
    and change the colors to whatever u want and put class="divscroll" in ur div
    <div class="divscroll">
     
    faithnomoread, Jul 19, 2008 IP
  3. faithnomoread

    faithnomoread Peon

    Messages:
    174
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    For the firts thing u can try overflow: auto; it will only put scroll bars if needed.
     
    faithnomoread, Jul 19, 2008 IP
    wd_2k6 likes this.
  4. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thankyou very much fiathnomoread,

    The overflow: auto; worked great..

    The coloured scrollbars also work good...but not in FireFox! I get them as desired in IE7, but in FF i still get the default ones!

    Any ideas anyone pleaseeeeeee

    Many Thanks in advance.
     
    wd_2k6, Jul 23, 2008 IP
  5. faithnomoread

    faithnomoread Peon

    Messages:
    174
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Not a problem, as for the scroll bars in firefox that is new area for me and I have been trying to study on it let me figure it out.
     
    faithnomoread, Jul 23, 2008 IP
  6. faithnomoread

    faithnomoread Peon

    Messages:
    174
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Just found out that u cant change scroll bars in firefox or opera cuz its messing with users settings. U can do it with javascript, but Im not fluent in that yet and will have to figure it out, I am curious as well so Im on a mission,lol.
     
    faithnomoread, Jul 23, 2008 IP
  7. faithnomoread

    faithnomoread Peon

    Messages:
    174
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok heres the deal:

    The only way to do it is to:
    1) delete any ties to W3C in ur HTML, change the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"> to just <HTML>.

    2) enter following text into <head>:
    <style>
    body{
    scrollbar-face-color: #808080; /*/ obviously change this to whatever you want /*/
    scrollbar-arrow-color: #FFFFFF;
    scrollbar-highlight-color: #FFFBF0;
    scrollbar-3dlight-color: #808080;
    scrollbar-shadow-color: #FFFBF0;
    scrollbar-darkshadow-color: #808080;
    scrollbar-track-color: #CCCCCC;
    }
    </style>
    <script>
    function selectCode(f){
    document.forms[f].elements[0].focus();
    document.forms[f].elements[0].select();
    }
    function changeScrollbarColor(C){
    if (document.all){
    document.body.style.scrollbarBaseColor = C
    }
    }
    </script>
    3) Change <body> to <body onload="changeScrollbarColor()">
    This should work. Of course change colors to whatever u like, U can not use any code for Mozilla. If that doesnt work, sorry I tried, and Ill keep looking, let me know.
     
    faithnomoread, Jul 23, 2008 IP
  8. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks so much mate for your help and assistance and time!
    It's late in UK, will try this tommorow and let you know on the developments!
    Again many thanks.
     
    wd_2k6, Jul 23, 2008 IP