title: Jquery and frame
body: <p>I have a page with a iframe inside, so with Jquery I want to adjust the height of the frame so it does not appear the scrollbar of the page, but appears only the scrollbar for the frame...</p>
  
  <p>I have also a header div(with toggle function applied to it) in this page so I have to calculate also this height(when it desappears and when it is visible)...</p>
  
  <p>I have tested this code and it works only with Chrome.....</p>
  
  <p>Here the code:</p>
  
  <pre><code>    var height_body = $('body').height();
      var height_header = $('#header').height(); 
      var height_logomenu = $('#logomenu').height(); 
  
  
      $('#frameconcessionaria').attr( 'height', height_body - height_header);
  
      $('#header').css({'display' : 'none'});
  
      $('body').css({'background-image' : 'none'});
  
      $('#logo').click(function() {
  
          if ($("#header").is(":hidden")) {
              $('#frameconcessionaria').attr( 'height', height_body - (height_header+height_logomenu));
              $("#header").slideDown("800",function() {
                  //animation completed
                  }   
              );
          } else{ 
              $("#header").slideUp("800",function() {
                  $('#frameconcessionaria').attr( 'height', height_body - height_logomenu);
                  }   
              );
          }
      });
  </code></pre>
  
  <p>and html:</p>
  
  <pre><code> &lt;body&gt;
  
  &lt;div id="header"&gt;&lt;/div&gt;
   &lt;!-- IFRAME --&gt;
  &lt;iframe src="&lt;?php echo $src; ?&gt;" id="frameconcessionaria" height="500px" width="100%" frameborder="0" scrolling="auto"&gt; This page requires iframe - Questa pagina ha bisogno degli iframe&lt;/iframe&gt;
  &lt;!-- END IFRAME --&gt;
  
  &lt;/body&gt;
  </code></pre>