title: How to preload iframe
body: <pre><code>function toggle(){
      $("#tempc").toggle(
          function () {
              $("#tempc").animate({width: 255, height: 220}, 1000);
              $("#tempc").html("");
              $("#tempc").css("background-color", "transparent");
              $("#tempc").html("&lt;iframe src='/src/stream.php?stream=1' width='255' height='225' frameborder='0' scrolling='no'&gt;&lt;/iframe&gt;&lt;br&gt;&lt;a href='javascript:;' onclick='hidegadget();' class='yellowblock'&gt;Sluit&lt;/a&gt;");
          },
          function () {
              $("#tempc").animate({width: 50, height:50}, 1000);
              $("#tempc").html("");
              $("#tempc").css("background-color", "#FFFF00");
  
              $.get('src/stream.php?stream=2', function(data002) {
                  $('#tempc').html(data002);
              });
          }
      );
  }
  
  $.get('src/stream.php?stream=2', function(data002) {
      $('#tempc').html(data002);
  });
  </code></pre>
  
  <p>A while ago I was trying to animate a div, well, it works now only one thing.
  When the first function is activated (starting row 3),  and iframe gets loaded. But now, how can I preload that iframe? Because when the animation is finished the iframe isn't loaded.</p>