title: JS causing infinite loop in Firefox
body: <p>A script on my page is causing an infinite loop in FireFox.</p>
  
  <p>Here is the Javascript:</p>
  
  <pre><code>function expandMothersRings(new_height)
  {
      window.scrollTo(0, 0);
      $('#mr-container').animate({
          height: new_height
      }, 100, function() {
          // Animation complete.
      });
  }
  </code></pre>
  
  <p>This is being called via <code>ExternalInterface</code> from a Flex object:</p>
  
  <pre><code>var tiles_height:Number = 175+Math.ceil(MothersRingData.getInstance().styleArrayCollection.length/4)*175;
  ExternalInterface.call("expandMothersRings", tiles_height + 300);
  </code></pre>
  
  <p>There is no issue in IE or Chrome. But for some reason the <code>expandMothersRings</code> function is infinitely looping in FF. </p>
  
  <p>The flex object is not expecting any return value from Javascript. Also if I change the JS function to look like:</p>
  
  <pre><code>function expandMothersRings(new_height)
  {
      alert(new_height);
  }
  </code></pre>
  
  <p>Then it only executes once. So something in the function is causing it to loop in Firefox.</p>
  
  <p>I do not know what?</p>
  
  <p>Here is <a href="http://www.kranichs.com/mothers-rings" rel="nofollow">the page</a></p>