Making an iframe take vertical space

Total Post:412


 1759  View(s)
Rate this:


I would like to have an iframe take as much vertical space as it needs to display its content and not display a scrollbar. Is it at all possible ?

Are there any workarounds?

Thanks in advance

  1. Re: Making an iframe take vertical space

    Hi Pravesh!

    This should set the IFRAME height to its content's height:

    <script type="text/javascript">
           var height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
                   document.getElementById('the_iframe').height = the_height;

    You may want to add scrolling="no" to your IFRAME to turn off the scrollbars.

      Modified On Mar-29-2018 10:52:00 PM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.