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() -1000){
    $(selector).css("position", "fixed");
    $(selector).css("bottom","0");
  }
  else
  {
    $(selector).css('bottom', "81px");
  }
});
I tried this code and it works for $(document).height() -500 ). But for some reason i can't understand it does not work when the value 500 is decreased to 100 or 81.
Try changing this value and see the difference