Auto Resize iframe Based on Content of iframe

Posted on 2011-10-20
Last Modified: 2013-11-05
Dear all,

A much asked question, but we have the below iframe embedded in a WordPress page, and we need the iframe to auto-resize each time the content of the iframe changes (i.e. when users click on a link in the iframe to go from one page to another each being longer or shorter than the other)... Width will always remain static.

<iframe src="http://ourwebsiteforums" frameborder="0" align="left" width="1075" height="100%"></iframe>

Please provide working code, and also note that we DO NOT want scrollbars to appear.

Thank you.
Question by:loyaliser
    1 Comment
    LVL 16

    Accepted Solution

    This does exactly what you are looking for:

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
    PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now