title: Efficient way to select elements touching top edge of viewport
body: <p>What would be computationally-efficient ways to select elements touching the top edge of browser window viewport as the page is scrolled?</p>
  
  <p>See attached image. Green elements are selected because they are touching the top edge.</p>
  
  <p><img src="https://i.stack.imgur.com/a4mKO.png" alt="scrolling"></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>An example of how I'll use this is to fade elements that are going off-screen. There may be hundreds of them on the page. Imagine a page like Pinterest. Computing offset and scrollTop for hundreds of them at the rate of scroll event, even if throttled still feels really inefficient.</p>