title: Iframe Dynamic Content Resize
body: <p>I have an iframe that re-sizes its own content. The First time the iframe loades, the content re-sizes fine, but content not changing on subsequent resizing or page scrolling.</p>
  
  <p>I have tried onresize,onmove...</p>
  
   
  
  <pre><code> &lt;script type="text/javascript"&gt;
      function autoIframe(frameId) {
          try {
              frame = document.getElementById(frameId);
  
              innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
  
              if (innerDoc == null) {
                  // Google Chrome
                  frame.height = document.all[frameId].clientHeight + document.all[frameId].offsetHeight + document.all[frameId].offsetTop;
              }
              else {
  
                  objToResize = (frame.style) ? frame.style : frame;
                  objToResize.height = (innerDoc.body.scrollHeight +200) + 'px';
  
                  //document.getElementById("autosizeframe").style.height=(innerDoc.body.scrollHeight+18)+'px';
                  //alert(frame.style.height+'-'+innerDoc.body.scrollHeight)
              }
          }
  
          catch (err) {
              document.getElementById("autosizeframe").style.height = '1600px';
              document.getElementById("autosizeframe").style.width = '1000px';
              //alert('Err: ' + err.message);
              window.status = err.message;
          }
      }
  </code></pre>
  
  <p></p>