Reputation: 47
I have a problem with following jquery code
if ($(window).scrollTop() >= ($(document).innerHeight() - $(window).innerHeight()))
In Google chrome the code is working perfectly but in Firefox or IE it doesn't. There's any way to rewrite it ?
Thank you!
EDIT:
After some debug.. the value of document height - window height is bigger than "window.scrollTop" so the following code is a possible fix
if ($(window).scrollTop() >= ($(document).innerHeight() - $(window).height() - 2)) {
Upvotes: 0
Views: 7422
Reputation: 28775
Use innerHeight()
instead of height()
There are some issues with height()
and IE
I faced the same problem and I used innerHeight()
and it worked.
Upvotes: 3