I have a problem with this jQuery script:
What I want to do is trigger a function when the end of the page is reached.
$(window).scroll(function() {
if (document.documentElement.clientHeight + $(document).scrollTop() >= document.body.offsetHeight ) {
// Display alert or whatever you want to do when you're
// at the bottom of the page.
if (autoscroll == 1) {
$('#loadMore').trigger('click');
}
}
});
But why is this code not working on Firefox?
1 Answer