个人/中介房源 求房源页面
This commit is contained in:
18
src/toolJs/downLoadMore.js
Normal file
18
src/toolJs/downLoadMore.js
Normal file
@@ -0,0 +1,18 @@
|
||||
//监听滚动条
|
||||
const loadMore = (loadFunction) => {
|
||||
let body = document.documentElement ? document.documentElement : document.body ?
|
||||
document.body :
|
||||
document.querySelector('.element');
|
||||
let scrollTop = body.scrollTop
|
||||
let clientHeight = body.clientHeight
|
||||
let offsetHeight = body.offsetHeight
|
||||
if (scrollTop + clientHeight === offsetHeight) {
|
||||
loadFunction()
|
||||
}
|
||||
}
|
||||
|
||||
const tool={
|
||||
loadMore
|
||||
}
|
||||
|
||||
export default tool
|
||||
Reference in New Issue
Block a user