<script type="text/javascript"> $(window).scroll( function() { if($(window).scrollTop() == $(document).height() - $(window).height()) { alert("it works"); } }); </script>