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 11 of 11
  1. #1
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts

    How to remove the iFrame scrollbars

    Hi,

    I wonder why the following iFrame has scrollbars:

    Code:
    <iframe width='600' height='200' frameborder='0' scrolling='no' src='https://docs.google.com/spreadsheet/pub?hl=en_US&key=0Aliqp0kGPjWsdERacHFDVzNzb1N3RHREZzYwVGQ5OVE&output=html&widget=true&chrome=false'></iframe>
    Thanks in advance!
    Mike

  • #2
    New Coder
    Join Date
    Aug 2011
    Posts
    51
    Thanks
    6
    Thanked 12 Times in 12 Posts
    The scroll bars that you were getting didn't come from iframe, but it was inside of the iframe. In the url if you set widget to false, it should go away.

    Code:
    <iframe width='600' height='200' frameborder='0' scrolling='no' src='https://docs.google.com/spreadsheet/pub?hl=en_US&key=0Aliqp0kGPjWsdERacHFDVzNzb1N3RHREZzYwVGQ5OVE&output=html&widget=false&chrome=false'></iframe>

  • #3
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ASTP001 View Post
    In the url if you set widget to false, it should go away.
    Thanks for the answer, but the result will be different from what I expect as it removes the spreadsheet footer too.

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there Rain Lover,

    if you don't want scrollbars then you will have to change the iframe width and height attributes.

    So...
    Code:
    <iframe width='800' height='254'...
    ...instead of...
    Code:
    <iframe width='600' height='200'...
    coothead

  • #5
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by coothead View Post
    Hi there Rain Lover,

    if you don't want scrollbars then you will have to change the iframe width and height attributes.
    Dear coothead,

    Yes it seems obvious, but the questions is why there are scrollbars although I set the scrolling attribute to 'no'.

  • #6
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there Rain Lover,

    I looked at the code again today, but strangely could not see the scrollbars that I saw yesterday.

    I tested this code in IE9, Firefox 6, Safari 5 and Opera 11...
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    
    <title></title>
    
    </head>
    <body>
    
    <div>
    <iframe width="600" height="200" frameborder="0" scrolling="no" 
    src="https://docs.google.com/spreadsheet/pub?hl=en_US&amp;key=0Aliqp0kGPjWsdERacHFDVzNzb1N3RHREZzYwVGQ5OVE&amp;output=html&amp;widget=false&amp;chrome=false">
    </iframe>
    
    </div>
    </body>
    </html>
    
    coothead

  • #7
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by coothead View Post
    Hi there Rain Lover,

    I looked at the code again today, but strangely could not see the scrollbars that I saw yesterday.
    That's because in your tests you've changed the URL parameter widget value to false. It removes the tabs on the spreadsheet footer.

  • #8
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there Rain Lover,

    I did not change "the URL parameter widget value to false".

    I just copied the code that you provided.

    coothead

  • #9
    Regular Coder
    Join Date
    Nov 2009
    Posts
    200
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Smile Maybe my eyes are too tired, but...

    Quote Originally Posted by coothead View Post
    Hi there Rain Lover,
    I just copied the code that you provided.
    Here's my code iframe source:
    https://docs.google.com/spreadsheet/...E&output=html&widget=true&chrome=false

    And here's the one I see in your code:
    https://docs.google.com/spreadsheet/...tput=html&amp;widget=false&amp;chrome=false

  • #10
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there Rain Lover,

    Sorry, but I may have done you an injustice.

    It seems that I copied ASTP001,s code by mistake.

    coothead

  • #11
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,718
    Thanks
    0
    Thanked 240 Times in 235 Posts
    Hi there Rain Lover,

    the scrollbars that you see do not belong to the iframe element but to the iframe content.

    You can prove this to yourself by setting the scrolling attribute to "yes".

    coothead


  •  

    Posting Permissions

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