outerWidth()

outerWidth()函数用于获取当前匹配元素的外宽度

jQueryObject.outerWidth( [ includeMargin ] )

外宽度默认包括元素的内边距(padding)、边框(border),但不包括外边距(margin)部分的宽度,即includeMargin默认为false.你也可以指定参数为true,以包括外边距(margin)部分的宽度

outerWidth()返回值为number类型,不适用于windowdocument

例子:var dis = ($('.tip').outerWidth() - $(this).outerWidth()) / 2;
原文地址:https://www.cnblogs.com/itlichen/p/5944694.html