2022年6月24日

判断元素是否将要出现在可视区域 ele.getBoundingClientRect().top

摘要: 这种要实时监听.getBoundingClientRect().top <div></div> 1. 获取可视区域高度 height = document.body.offsetHeight 2. 获取元素距离浏览器 body 的 top border的距离 distanceBodyAbove = 阅读全文

posted @ 2022-06-24 02:10 In-6026 阅读(51) 评论(0) 推荐(0) 编辑

导航