Event occur on scrolldown
<p>I am just trying to execute some code when the scroll bar of the page is about halfway down my page (or 500px). The issue is that this code works for going all the way to the bottom of the page to execute but if I supply numbers nothing happens when scrolling. Does anyone know how to have it so the event will execute when scrolling 500px down?</p>

<p><strong>Works</strong></p>

<pre><code>$(window).scroll(function(){
        if  ($(window).scrollTop() == $(document).height() - $(window).height()){
</code></pre>

<p><strong>Does Not</strong></p>

<pre><code>$(window).scroll(function(){
        if  ($(window).scrollTop() == parseInt(500)){
</code></pre>
