I have a div that animates up and down as you scroll, here’s the code,
$(document).ready(function(){
$(window).scroll(function () {
set = $(document).scrollTop()+"px";
$('#bymail-inner').animate({top:set},{duration:500,queue:false});
});
});
It works really great, however is there a way to stop it once it has reached close to the bottom of the page?
There’s a pretty good way of detecting if a user has scrolled near the bottom of the page using a little DOM math: