首页
Python
Java
前端
数据库
Linux
Chatgpt专题
开发者工具箱
outerheight专题
各种位置和高度计算:.position()、.offset()、.outerHeight()、.scrollTop、.scrollHeight、.clientHeight
1、.position()和.offset() jquery的.position()获取相对于最近的position为relative或absolute的父元素的偏移,返回.position().left和.position().top,不算上自己的margin-left; jquery的.offset()获取相对于视口左上角的偏移,返回.offset().left和.offset().top
阅读更多...