摘要: getBoundingClientRect可以根据dom的四个边获得与window上边或左边的距离。 const obj = dom.getBoundingClientRect();obj.top = dom的上边距离window上边的距离;obj.bottom = dom的下边距离window上边 阅读全文
posted @ 2021-01-13 15:05 tristam 阅读(239) 评论(0) 推荐(0) 编辑