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 9 of 9
  1. #1
    New Coder
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Turning Scrollbars OFF

    Okay, here's the problem. I want to turn off the scrollbars. I've got an html file with an iframe. I want the iframe to have a vertical scrollbar as needed, but I don't want the main html file to have any scrollbars and I also don't want the iframe to have a horizontal scrollbar. It looks fine in Opera, but in IE the carrier page has a vertical scrollbar even though there's nothing to scroll and the iframe has a vertical and horizontal scrollbar. so how can I get rid of the unnecessary/unwanted scrollbars?

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Put scroll="no" in your body tag or css file. As for the iframe the scrollbars can't be controlled separately so to ensure you have no horizontal scroller you will have to make sure the iframe is wide enough to accomodate the incoming data.

    BaldEagle

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I'm not sure if scroll="no" works in other browsers but IE, so add this to your head tags, just keep in mind this may cause problems when it comes to accessibility.
    Code:
    <style type="text/css">
    <!--
    html,body {
    overflow:hidden;
    }
    -->
    </style>
    Last edited by _Aerospace_Eng_; 05-01-2005 at 05:29 AM.

  • #4
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I checked IE and FF and it does work, however, after checking my references I am now pretty sure it would not validate, therefore _Aerospace_eng has the correct answer.

    Thanks for keeping me honest

    BaldEagle

  • #5
    New Coder
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well the scroll="no" works pretty well. and it seems whatever the html file in the iframe's settings are carries over to the iframe. but the trouble with IE is when the vertical scrollbar is present, it adds the horizontal scrollbar ('cause the vertical scrollbar occupies about 10 or so pixels of the iframe reducing the visual space). I mean, the document doesn't even have to take up the width of the whole iframe, but if it is long enough to scroll vertically IE is adding the horizontal scroll in response to the vertical scroll bar limiting the horizontal space. Does that make sense? Isn't there a way to turn off just the horizontal scroll bar? I mean, I could handle the vertical always being there if the horizontal would NEVER be there.

  • #6
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    you have a pge up with this on it or some source code? it's probally a width problem in the iframe. if the area is small enough to fit IE will drop the horizontal scroll bar.

  • #7
    New Coder
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <body bottommargin="0" leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" topmargin="0" bgcolor="#000000" scroll="no">
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td height="32">&nbsp;</td>
    <td valign="top" align="center" height="32" width="734" background="bgx.gif"><img src="menux.gif" width="739" height="32"></td>
    <td valign="top" align="right" height="32"></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td width="739" align="left" valign="top" background="bgx.gif"><iframe src="home.html" width="100%" height="100%" frameborder="0" id="content" name="content" marginheight="0" marginwidth="0"></iframe></td>
    <td valign="top" align="right">
    *</td>
    </tr>
    <tr>
    <td height="14">&nbsp;</td>
    <td valign="bottom" height="14" align="center" background="bgx.gif"><img src="copyrightx.gif" width="739" height="14"></td>
    <td height="14" valign="bottom" align="right">
    </td>
    </tr>
    </table>
    </body>

    and right now the html in the iframe is just a bunch of rows of the letter k long enough to cause a vertical scroll. one letter per line.

  • #8
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,801
    Thanks
    8
    Thanked 131 Times in 129 Posts
    http://home.earthlink.net/~harbinger...elvoivner.html

    check that.

    Giving the Iframe a 100% height didn't work. Nor did giving the TD that it was in. So I gave it 500px to make a space.

    In your Home.html (my kpe.html file) file how wide is the table? Anything over 720px is going to cause a horizontal scroll. The scroll bar is roughly 15px wide (739-15=724 I know) but 724 broke the horizontal.

  • #9
    New Coder
    Join Date
    Apr 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the table itself is 100% the width of the window. the central column is 734 because I wanted to make sure all the content could fit in a 800x600 resolution maximized window. so essentially the central column is the only column that has any actual definite width as the side-columns are just black filler space to compliment the aesthetic.

    But the 720px width works out pretty well, thanks.


  •  

    Posting Permissions

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