两种盒模型
l IE传统模型:width和height属性包括内边距和边框宽度
l W3C标准模型:width和height属性不包含边距和边框宽度
jQuery.boxModel
jQuery提供了boxModel属性,jQuery.boxModel为true时,表示支持W3C盒模型,false表示支持IE传统盒模型。
尺寸封装
jQueryn封装了这两种盒模型的差异,统一为W3C标准模型,并提供了修正后的接口:
接口 |
计算公式 |
width, height |
content |
innerWidth, innerHeight |
content+padding |
outerWidth, outerHeight |
content+padding+border+可选的margin |
