Home > Article > Web Front-end > How does jQuery scroll to an element and call the corresponding function_html/css_WEB-ITnose
Just like the title
For example, if my page scrolls to 2e40c084d5946e434ae66558c9fbfb2816b28748ea4df4d9c2150843fecfba68, I will call the call() function. How to achieve this? No need for jQuery plug-ins such as waypoint
Who knows? You can also enter 9995 characters
for a bit. You can also enter 9994 characters
and calculate the distance of the scroll bar relative to the document and the distance of the div relative to the document. They are equal. method is called when dolphinX/archive/2012/11/19/2777756.html
From: Bitter Man
$(window).scroll(function() { var body = document.body && document.body.scrollTop? document.body : document.documentElement; var height = parseInt(body.scrollHeight) - parseInt(screen.height); if(body.scrollTop >= height) { //开始做你的事情吧。。。 } });