title: Dynamic iframe height with css or jquery
body: <p>I am creating iframes dynamically using jquery, the height of the iframe is too large, i want to set auto height to this iframe. When data is loaded the iframe should adjust automatically, i am trying to achive this in a click event</p>
  
  <p>Note: I am creating this dynamically, so there is multiple iframes in my page.</p>
  
  <pre><code> $( ".deletephoto" ).live('click',function (event){
   event.preventDefault();
   if (confirm("Are you sure you want to delete this photo?")) {
     var iframediv=$(this).parent().find('#ifarmediv');
     $(iframediv).html("&lt;iframe src='../users/upload' id='the_iframe' class='iframephotoedit'&gt;&lt;/iframe&gt;");
  
     var   currentiframe=$(this).parent().find('#ifarmediv').find('iframe');
      $(currentiframe).load(function() {
                        $(this).height( $(this).contents().find("body").height() );
                      }); 
  </code></pre>
  
  <p>});</p>