"Infinite scroll"-like. Make it fire before bottom
<p>I'm using this small script to define if the user've scrolled to the bottom</p>

<pre><code>$(window).scroll(function(){

    if($(window).scrollTop() == $(document).height() - $(window).height()){
        if(!taskFired){
            taskFired = true;
            $("#loading_gif").css("display", "block");
            setTimeout(loadMoreMabs, 1500);
        }
    }

});
</code></pre>

<p>But I wan't it to fire the function loadMoreMabs <em>before</em> the bottom is reached. How would I do that? I've tried to + and - with the heights, but it's like I'm experimenting with something I don't really get.</p>
