-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
上拉加载的简单实现 #16
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
获取滚动条滚动的距离
根据页面是否声明doctype需要做一下兼容处理,并且不同浏览器也会有一些差异。这里有个参考,文章给出了一个解决方案:
关于
clientHeight
,offsetHeight
,scrollHeight
,offsetTop
,scrollTop
不是那么好区分,这里也有一个挺好的参考获取当前可视范围的高度
获取文档完整的高度
滚动时触发
由于滚动事件触发的比较频繁,可以利用节流函数来处理一下,参考《javaScript高级程序设计》p615,throttle(n.节流阀;vi.节流,减速)函数
The text was updated successfully, but these errors were encountered: