What I would like to know when the user sees the main view of my application and it reaches the end, the footer should appear in a colorful way, I currently have several lines of code in juqery that should send me an alert when I arrive in the end, but it does the opposite and sends me the alert when I'm up.
Current code:
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
alert("END!");
}
});