(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-
Difference between $(window).height() and $(document).height() function.
$(window).height() function:
Ideally $(window).height() returns the pixel less height of browser window. This is always the height of current browser window. If you resize browser this value should change.
$(document).height() function: $(document).height() returns an unit-less pixel value of the height of the document being rendered.
In HTML if you dont declare DOCTYPE then all time HTML page returns $(window).height() and $(document).height() same value.
$(window).height() =
$(document).height() =
Lorem ipsum dolor sit amet
Output :
$(window).height() = 750
$(document).height() = 750
Lorem ipsum dolor sit amet
After declare DOCTYPE its returns perfect value.
write above code here
Output :
$(window).height() = 750
$(document).height() = 750
Lorem ipsum dolor sit amet