title: Determine if an element in an iframe is visible on the screen
body: <p>I need to determine if an element in an iframe is visible on the screen. (if it is on the visible part of the screen)
  I mean the page can be very long and user must scroll to see the element </p>
  
  <p>index.html:</p>
  
  <pre><code>&lt;html&gt;
  ...
  ...
  &lt;iframe src="iframe.html" /&gt;
  ...
  ...
  &lt;/html&gt;
  </code></pre>
  
  <p>iframe.html:</p>
  
  <pre><code>&lt;html&gt;
  ...
  ...
  &lt;div id="element"&gt;&lt;/div&gt;
  ....
  ...
  &lt;script type="text/javascript"&gt;
      var el = document.getElementById('element');
      if (isElementVisible(el)) {
        // do something
      }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How to write such a function isElementVisible()?  </p>