jQuery innerWidth() 和 innerHeight() 方法
- 作者: 五速梦信息网
- 时间: 2026年03月19日 18:18
jquery 提供了 width() 、 height() 、innerWidth() 、innerHeight() 、 outerWidth() 、 outerHeight() 用来处理元素和浏览器窗口的尺寸
jQuery 尺寸方法
jQuery 提供六个方法用来处理尺寸
- width()
- height()
- innerWidth()
- innerHeight()
- outerWidth()
- outerHeight()
jQuery 尺寸

jQuery width() 和 height() 方法
jQuery width() 方法设置或返回元素的宽度,不包括内边距、边框或外边距
jQuery height() 方法设置或返回元素的高度,不包括内边距、边框或外边距
下面的范例返回指定的 <div> 元素的宽度和高度
jQuery innerWidth() 和 innerHeight() 方法
jQuery innerWidth() 方法返回元素的宽度,包括内边距
jQuery innerHeight() 方法返回元素的高度,包括内边距
下面的范例返回指定的 <div> 元素的 inner-width/height
jQuery outerWidth() 和 outerHeight() 方法
jQuery outerWidth() 方法返回元素的宽度,包括内边距和边框
jQuery outerHeight() 方法返回元素的高度,包括内边距和边框
下面的范例返回指定的 <div> 元素的 outer-width/height
本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!
- 上一篇: jQuery 遍历 后代
- 下一篇: jQuery css() 方法








