title: jquery or not / Cross Browser Compatible iframe resize (IE, Chrome, Safari, Firefox)
body: <p>Here is my issue. I have been looking hard for a cross browser iframe resize code to use and i just cant find one. All i have seen has issues in one browser over another. Here is what i am doing. I am loading an iframe into the page in an jquery tools overlay. This iframe will load contents of a page (on the same domain so dont need to worry about cross domain). When a user clicks an action on that form the iframe will again need to resize (i have it working for when the iframe increases but not when the iframe decreases). </p>
  
  <p>I have a js file that is included in the iframe which has this function</p>
  
  <pre><code>$(window).load(function(){
      parent.adjust_iframe();
  });
  </code></pre>
  
  <p>That function then calls the parent pages function like so:</p>
  
  <pre><code>function adjust_iframe() {
  
      //i have tried both body and html and both dont work in IE
      var h = $("#overlayFrame").contents().find("body").height();
      if(h==0)
      h="500";
      else
      h=h+3;
  
      $("#overlayFrame").css({'height': h});
      window.scrollTo(0,0);
  
  }
  </code></pre>
  
  <p>The above code works fine in Chrome and firefox but not in IE.</p>
  
  <p>Any help here? I really need a cross browser compatible light weight solution that doesnt involve some heavy jquery plugin that isnt supported.</p>
  
  <p>Thanks!</p>