title: Some correction about jquery and iframe?
body: <p>I create a simple greasemonkey script, it's attached new menu on a page, when clicked it will show the iframe, I want to make sure that when I click the menu the iframe has already fully loaded, so I created this</p>
  
  <pre><code>$('&lt;div id="googleBar"&gt;&lt;iframe id="googleBarFrame" scrolling="no" frameborder="0" src="http://support.google.com/plus/bin/answer.py?hl=en&amp;amp;answer=1053549"&gt;&lt;/iframe&gt;&lt;/div&gt;').insertBefore('#pagelet_welcome_box');
  
  $('#googleBarFrame').load(function() 
  {
      $('#pageNav').prepend('&lt;li id="navShare" class="topNavLink middleLink"&gt;&lt;a accesskey="1" &gt;Google+ Share&lt;/a&gt;&lt;/li&gt;');
  });
  
  //This not working
  var toggle = false;
  $('#navShare').click(function() {
      if (toggle) {
          $("#googleBar").animate({
          height: '30px',
          }, 500 );
      toggle = false;
      }
      else {
          $("#googleBar").animate({
          height: '250px',
          }, 500 );
      toggle = true;
      }
  });
  </code></pre>
  
  <p>but that's not working, and this my working script but without ability to detect iframe has loaded</p>
  
  <pre><code>$('#pageNav').prepend('&lt;li id="navShare" class="topNavLink middleLink"&gt;&lt;a accesskey="1" &gt;Google+ Share&lt;/a&gt;&lt;/li&gt;');
  
  $('&lt;div id="googleBar"&gt;&lt;iframe id="googleBarFrame" scrolling="no" frameborder="0" src="http://support.google.com/plus/bin/answer.py"&gt;&lt;/iframe&gt;&lt;/div&gt;').insertBefore('#pagelet_welcome_box');
  
  var toggle = false;
  $('#navShare').click(function() {
      if (toggle) {
          $("#googleBar").animate({
          height: '30px',
          }, 500 );
      toggle = false;
      }
      else {
          $("#googleBar").animate({
          height: '250px',
          }, 500 );
      toggle = true;
      }
  });
  </code></pre>