title: Using JQuery to scroll an iframe from the parent
body: <p>I'm trying to scroll an iframe from the parent window using JQuery. In other words, set up scroll buttons on the parent page that scroll the child iframe. It works fine with JavaScript, using:</p>
  
  <pre><code>function scroller(howMuch) 
  {
          var myIframe = document.getElementById('iframeid');
  
          myIframe.contentWindow.scrollBy(0,howMuch);
  }
  </code></pre>
  
  <p>then calling the function from:</p>
  
  <pre><code>&lt;a href="javascript:scroller(-50)"&gt;Scroll Up 50 px&lt;/a&gt;
  </code></pre>
  
  <p>But trying to use JQuery to use animate() instead of the clunky scrollBy() hasn't been easy. I've tried</p>
  
  <pre><code>$('#iframeid').contentWindow.animate({scrollTop : 50});
  </code></pre>
  
  <p>for example. I'm fairly certain this is how to access the iframe's contentWindow from JQuery- can't find much on the subject. One problem could be that the parent page is set to scroll: none (the iframe is set to default). Could this be the dealbreaker or am I missing something else? I realize I can code a delay loop in JavaScript but this has piqued my curiosity.</p>