title: Get and compare DIV position with scroll
body: <p>I need to compare the scroll position with and element position (relative to window top) and when both have the same value, do something (this case <code>console.log("we are the same")</code>).</p>
  
  <p>I've tried the following code, but it's not working. I added an image to explain better.</p>
  
  <pre><code>if ($('.contenedorbusiness figure').length) {
      $(document).scroll(function(event) {
  
          var alto_total = $(this).scrollTop();
          var loader_business = $('.loader_business').offset().top;
  
          if (alto_total  == loader_business.top) {
              console.log(alto_total + " == " + parseInt(loader_business));
          }
      });
  }
  </code></pre>
  
  <p>What I want is:</p>
  
  <p><img src="https://i.stack.imgur.com/Ch0PW.png" alt="Image"></p>