$(document).height(): The height of the entire web page
$(window).height(): The height of the browser’s visible window
$(window).scrollTop(): The height from the top of the browser’s visual window to the top of the web page (vertical offset)
To understand it in one sentence: when the scroll bar of the web page is pulled to the lowest end, $(document).height() == $(window).height() $(window).scrollTop().
When the height of the web page is less than the browser window, $(document).height() returns $(window).height().
It is not recommended to use heights such as $("html").height() and $("body").height().
Reason:
$("body").height(): The body may have a border, and the obtained height will be smaller than $(document).height();
$("html").height(): The meaning of the height obtained on different browsers will be different. To put it bluntly, the browser is incompatible.
There is something wrong with the $(window).height() value. What is returned is not the height of the browser window?