 <p>You're on the right track. Bind an event to the document to check for scrolling and see what the height is.</p> <pre><code>$(document).scroll(function(){ var scrollTop = $("html").scrollTop(); if(scrollTop &gt; 150){ $(".background2").fadeIn(); } else $(".background2").fadeOut(); }) </code></pre>