I am running in a bit of a problem here trying to figure out this one.
I already coded a jquery function that detects when the user hits the bottom of the page and trigger an function.
Now, while this works alright for the most common screen-sizes, it will not work when the user has a screen so big that sees the entire page at once, rendering the previous function useless.
What I am trying to achive is the fallback for those cases, how can I tell if the user has such a screensize that will trigger the function and leave the rest to the other?
Better explained: How to detect if the user browser-height is equal or greater than the page body height?
Sorry if this looks a bit confusing.
PS: The following code is the one I am using when the browser-height is smaller than the page body-height.
if ($('body').height() <= ($(window).height() + $(window).scrollTop())) {
//run function here when the browser-height is smaller than
//the page's height and it has reached the bottom
}
$(document).height(); // returns height of HTML document