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)) {
Use
innerHeight()instead ofheight()There are some issues with
height()andIEI faced the same problem and I used
innerHeight()and it worked.