There is a function with which you can check "whether the site scrolled up to the visibility of a particular object":
function isScrolledIntoView(elem) { var docViewTop = $(scroll).scrollTop(); var docViewBottom = docViewTop + $(scroll).height(); var elemTop = $(elem).offset().top; var elemBottom = elemTop + $(elem).height(); return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); } Suppose isScrolledIntView('footer') returns true if we scroll down and see the footer.
I would like to know how you can change a function and set parameters to it, to determine if we allow * scrolled .testdiv 'a to .li:last-child , which is in it, ie Check the position of the block scrolling, and not the entire window with respect to internal objects?