Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (33 sloc) 1.56 kB
<?xml version="1.0"?>
<entry type="method" name="outerWidth" return="Integer">
<title>.outerWidth()</title>
<signature>
<added>1.2.6</added>
<argument name="includeMargin" optional="true" type="Boolean">
<desc>A Boolean indicating whether to include the element's margin in the calculation.</desc>
</argument>
</signature>
<desc>Get the current computed width for the first element in the set of matched elements, including padding and border.</desc>
<longdesc>
<p>Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.</p>
<p>If <code>includeMargin</code> is omitted or <code>false</code>, the padding and border are included in the calculation; if <code>true</code>, the margin is also included.</p>
<p>This method is not applicable to <code>window</code> and <code>document</code> objects; for these, use <code><a href="/width">.width()</a></code> instead.</p>
<p class="image">
<img src="/resources/0042_04_06.png"/>
</p>
</longdesc>
<example>
<desc>Get the outerWidth of a paragraph.</desc>
<code><![CDATA[var p = $("p:first");
$("p:last").text( "outerWidth:" + p.outerWidth()+ " , outerWidth(true):" + p.outerWidth(true) );
]]></code>
<css><![CDATA[
p { margin:10px;padding:5px;border:2px solid #666; }
]]></css>
<html><![CDATA[<p>Hello</p><p></p>]]></html>
</example>
<category slug="css"/>
<category slug="dimensions"/>
<category slug="manipulation/style-properties"/>
<category slug="version/1.2.6"/>
</entry>
Jump to Line
Something went wrong with that request. Please try again.