When user scrolls to the bottom of the page I want to show some div, with jQuery of course. And if user scrolls back to he top, div fade out. So how to calculate viewport (o
You can use the following:
$(window).scroll(function() { if ($(document).height() <= ($(window).height() + $(window).scrollTop())) { //Bottom Reached } });
I use this because i have
body { height:100%; }
Hope this helps