I\'ve got a div which I need to be fixed to the bottom of the screen, until it reaches some point after scrolling and stop there and stay. If a user start scrolling back up - ma
$(window).scroll(function () {
if ($(this).scrollTop() < $(document).height() - 81) {
$('#bottom_pic').css("position", "fixed");
$('#bottom_pic').css('bottom', "0px");
}
else {
$('#bottom_pic').css("position", "absolute");
$('#bottom_pic').css({'top':(($(document).height())-81)+'px'});
}
});
This will make the div fixed at bottom until its 81px away from the top. Once it reaches there, it will stay there.