(Hope it is not a duplicate because I didn’t find it when searching and googling)
I am trying to find how to detect in some fixed-height div (‘#div’) when the scroll-bar is reaching the bottom of this latter div. Should I use $(document).height() and $(window).height() to detect this event ?
Edit : My div which is fixed-height and about which I set auto-scroll, so how to deal with that ? if I am suppose to use $(‘#div’).height(), this height is fixed….
In the
.height()documentation:In your case it sounds like you may want the height of the
documentrather than thewindow. Think of it this way: Thewindowheight is what you see, but thedocumentheight includes everything below or above.EXAMPLE
EDIT:
Checking for top and bottom on scroll with help from the
scrollTop()method: