This must be some silly error but in my javascript function, the if
statment that should be executing when i reach bottom of screen, is executing when i reach top of my screen ...
Here is my code :
$(window).scroll(function() { //detect page scroll
if($(window).scrollTop() + $(window).height() == $(document).height()) //user scrolled to bottom of the page?
{
$('.animation_image').show(); //show loading image
}
});
.animation_image
is a loading image that should appear when i reach bottom of screen but is appearing when i scroll down and then back up to the top of the screen ...
If someone can explain what i am doing wrong, that would be great !