title: How to check scroll position in front of div
body: <p>I created one parent div that has scroll. It has children divs which have text content, I want to check if scroll is in front of one of the child divs. </p>
  
  <p>I tried it by comparing top scroll position with </p>
  
  <p><strong>div.offset().top</strong></p>
  
  <p>but as I am scrolling down div will calculate only visible height from parent with offset top position and scroll will calculate it's top from starting of parent. I am checking scroll's position like so:</p>
  
  <pre><code>if(scrollPosition&gt;div.offset().top &amp;&amp; scrollPostion (div.offset.top+div.height) ) {//scroll present }
  </code></pre>
  
  <p>What is correct way of getting div's top position? </p>
  
  <p>Blockquote</p>
  
  <p>Thanks in advance.</p>