I have a div at the bottom of the screen in fixed position with an arrow inside. How do I hide the div when the user has scrolled to the bottom of the page?
Asked
Active
Viewed 254 times
3
-
1Please post your code, with samples of what have you have tried already. – BenM Jan 31 '13 at 08:35
-
1I think it's already answered: http://stackoverflow.com/questions/3898130/how-to-check-if-a-user-has-scrolled-to-the-bottom, :-) – German Latorre Jan 31 '13 at 08:42
3 Answers
3
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
$('div').hide();
}
});

Chris Visser
- 1,607
- 12
- 24
2
Try this:
var vericalscroll= document.height - (window.pageYOffset + window.innerHeight);
if your vericalscroll
is 0,it means you have reched at the end of vertical scroll.

Milind Anantwar
- 81,290
- 25
- 94
- 125