Dynamically resize IFRAME??


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Dynamically resize IFRAME??

Hybrid View

  1. #1
    Ram Guest

    Dynamically resize IFRAME??


    Is it possible to dynamically resize an IFRAME? Meaning, I specify the height
    of the IFRAME to 69%. In some cases, the dynamically generated content that
    fills the IFRAME happens to be bigger than the height I specify. I would
    like to detect the height using a script and then resize it to show all content.
    I was hoping clientHeight would give me this but it always gives the fixed
    height of the IFRAME. Here is the code. init() is just a test called onLoad().

    function init()
    {
    var clientheight = document.all["compInfoFrame1"].clientHeight;
    alert("Height" + clientheight);
    }

    <!--inside the HTML--->
    <IFRAME width="100%" name="compInfoFrame1" id="compInfoFrame1" height="69%"
    scrolling="no" frameborder="no"
    src = "../asp/compInfoProxy.asp?ticker=IBM.N">
    </IFRAME>

    Any help?

    Many thanks
    Ram

  2. #2
    Ken Guest

    Re: Dynamically resize IFRAME??


    The article below describes how you can do this. The
    catch is that you need to add a Javascript onLoad event
    handler to the page you want to frame. In other words,
    this won't work if you want to Iframe someone else's
    webpage, but it works wonders if you are framing your
    own pages...

    http://www.faqts.com/knowledge_base/...d/1076/fid/127

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center