title: How to implement an 'onVisible' event in JavaScript?
body: <p>Is there any technique or set of techniques that can be used to implement what, in effect, would be an <code>onVisible</code> 'event' in JavaScript?</p>
  <p>I would like my JavaScript to detect when an element in a web page, such as a paragraph of text, or an image, becomes visible in a browser window as a user scrolls down a page. I would also like a corresponding 'event', <code>onNotVisible</code>, to fire when an element that was once visible in the browser window can no longer be seen.</p>
  <p>If it cannot be easily implemented in JavaScript, are there any browser specific events that can provide the same functionality?</p>