I've done a bit more research and found the following link, which I
think is related:  http://www.pithill.org/opera9.5_jquerybug.html.
The source code for that web page implies that for Opera 9.5, the
value of $(window).height() should be set to the value of
window.innerHeight.

Also, sorry about the mess in the previous post.  I've tried to
reformat the table, below. (Is there any sort of monospaced font
option in Google Groups?  Are we stuck with the 40 column, or so, wrap-
around?)

----------------  Original Post reformatted  ----------------

To determine if the document's vertical scroll bar is at the "bottom"
of its travel, I've seen this calculation:

delta = $(document).height() - $(window).height();
scrollTopIsAtMax =  ($(window).scrollTop() == delta);

As the document's scroll bar is scrolled down, the value of $
(window.scrollTop()) increases until it equals the value of delta,
signifying the scrollbar is at the bottom end of its travel.

Using jquery-nightly.js for June 28/08 with the DOCTYPE in strict mode
I get the following when the scrollbar is at the bottom of its travel
(all windows maximized):

jQuery browser info     msie7.0
$(document).height()    1170
$(window).height()        626
delta                           544
$(window).scrollTop()   544
scrollTopIsAtMax        true

jQuery browser info      mozilla1.9  (FFox 3.0)
$(document).height()    1015
$(window).height()         583
delta                            432
$(window).scrollTop()    432
scrollTopIsAtMax         true

jQuery browser info      safari525.19
$(document).height()    1006
$(window).height()        634
delta                            372
$(window).scrollTop()    372
scrollTopIsAtMax         true

jQuery browser info      opera9.50
$(document).height()    896
$(window).height()        880
delta                           16
$(window).scrollTop()    237
scrollTopIsAtMax         false

As you can see, this algorithm doesn't work for Opera.  Is there a
more jQueryesq way to determine when the scrollbar is at its end?

Thanks,
Bill

Reply via email to