vue中元素中的滚轮 滚动事件
<div @scroll.passive="scrollHandle" style="width:80px;height:100px;overflow-y:auto;">div>
元素加上高度
function scrollHandle(e){console.log("高度" + e.target.scrollHeight);console.log("距离上面" + e.target.scrollTop);console.log("元素高度" + e.target.clientHeight);// 滚动条距离底部的距离scrollBottomlet scrollBottom =e.target.scrollHeight -e.target.scrollTop -e.target.clientHeight;// if (scrollBottom < 100) {// 操作// }console.log("距离底部" + scrollBottom);
}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
