uni-app判断是否到底部
【代码】uni-app判断是否到底部。
·
//获取某DIV高度
uni.createSelectorQuery().select('.lists').boundingClientRect((res) => {
uni.pageScrollTo({
scrollTop: res.height,
duration: 200
})
}).exec()
//在onPageScroll函数中判断 is_scroll_view 为true就是到底部
let to_scroll_top = e.scrollTop+20
uni.createSelectorQuery().select('.lists').boundingClientRect((res) => {
let a = uni.getSystemInfoSync()
let t_height = res.height-a.screenHeight
if(t_height<=to_scroll_top){
this.is_scroll_view = true
}else{
this.is_scroll_view = false
}
}).exec()
更多推荐
已为社区贡献3条内容
所有评论(0)