jQuery 教程
返回 <div> 元素的外部寬度:
outerWidth() 方法返回第一個(gè)匹配元素的外部寬度。
如下面的圖像所示,該方法包含 padding 和 border。
提示:如需包含 margin,請(qǐng)使用 outerWidth(true)。
相關(guān)方法:
參數(shù) | 描述 |
---|---|
includeMargin | 可選。布爾值,規(guī)定是否包含 margin。
|
包含 margin
規(guī)定是否包含 margin。
通過(guò)相關(guān)方法顯示尺寸
如何使用 width()、height()、innerHeight()、innerWidth()、outerWidth() 和 outerHeight()。