outerWidth()

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

jQueryObject.outerWidth( [ includeMargin ] )

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

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

例子:var dis = ($('.tip').outerWidth() - $(this).outerWidth()) / 2;

 

posted @ 2016-10-10 09:55  Sunny_Lee  阅读(229)  评论(0编辑  收藏  举报