Skip to content

Dimensions: Document empty-context getters #998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entries/innerHeight.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</signature>
<desc>Get the current computed height for the first element in the set of matched elements, including padding but not border.</desc>
<longdesc>
<p>This method returns the height of the element, including top and bottom padding, in pixels.</p>
<p>This method returns the height of the element, including top and bottom padding, in pixels. If called on an empty set of elements, returns <code>undefined</code> (<code>null</code> before jQuery 3.0).</p>
<p>This method is not applicable to <code>window</code> and <code>document</code> objects; for these, use <code><a href="/height/">.height()</a></code> instead.</p>
<figure>
<img src="/resources/0042_04_02.png"/>
Expand Down
2 changes: 1 addition & 1 deletion entries/innerWidth.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</signature>
<desc>Get the current computed inner width for the first element in the set of matched elements, including padding but not border.</desc>
<longdesc>
<p>This method returns the width of the element, including left and right padding, in pixels.</p>
<p>This method returns the width of the element, including left and right padding, in pixels. If called on an empty set of elements, returns <code>undefined</code> (<code>null</code> before jQuery 3.0).</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>
<figure>
<img src="/resources/0042_04_05.png"/>
Expand Down
10 changes: 5 additions & 5 deletions entries/outerHeight.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<entries>
<desc>Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements.</desc>
<desc>Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements or set the outer height of every matched element.</desc>
<entry type="method" name="outerHeight" return="Number">
<title>.outerHeight()</title>
<signature>
Expand All @@ -9,10 +9,10 @@
<desc>A Boolean indicating whether to include the element's margin in the calculation.</desc>
</argument>
</signature>
<desc>Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns a number (without "px") representation of the value or null if called on an empty set of elements.</desc>
<desc>Get the current computed outer height (including padding, border, and optionally margin) for the first element in the set of matched elements.</desc>
<longdesc>
<p>The top and bottom padding and border are always included in the <code>.outerHeight()</code> calculation; if the <code>includeMargin</code> argument is set to <code>true</code>, the margin (top and bottom) 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="/height/">.height()</a></code> instead.</p>
<p>Returns the height of the element, including top and bottom padding, border, and optionally margin, in pixels. If called on an empty set of elements, returns <code>undefined</code> (<code>null</code> before jQuery 3.0).</p>
<p>This method is not applicable to <code>window</code> and <code>document</code> objects; for these, use <code><a href="/height/">.height()</a></code> instead. Although <code>.outerHeight()</code> can be used on table elements, it may give unexpected results on tables using the <code>border-collapse: collapse</code> CSS property.</p>
<figure>
<img src="/resources/0042_04_03.png"/>
<figcaption>Figure 1 - Illustration of the measured height</figcaption>
Expand Down Expand Up @@ -60,7 +60,7 @@ $( "p:last" ).text(
<desc>A function returning the outer height to set. Receives the index position of the element in the set and the old outer height as arguments. Within the function, <code>this</code> refers to the current element in the set.</desc>
</argument>
</signature>
<desc>Set the CSS outer Height of each element in the set of matched elements.</desc>
<desc>Set the CSS outer height of each element in the set of matched elements.</desc>
<longdesc>
<p>When calling <code>.outerHeight(value)</code>, the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used (such as <code>100px</code>, <code>50%</code>, or <code>auto</code>).</p>
</longdesc>
Expand Down
8 changes: 4 additions & 4 deletions entries/outerWidth.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<entries>
<desc>Get the current computed width for the first element in the set of matched elements, including padding and border.</desc>
<desc>Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements or set the outer width of every matched element.</desc>
<entry type="method" name="outerWidth" return="Number">
<title>.outerWidth()</title>
<signature>
Expand All @@ -9,10 +9,9 @@
<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>
<desc>Get the current computed outer width (including padding, border, and optionally margin) for the first element in the set of matched elements.</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>Returns the width of the element, including left and right padding, border, and optionally margin, in pixels. If called on an empty set of elements, returns <code>undefined</code> (<code>null</code> before jQuery 3.0).</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. Although <code>.outerWidth()</code> can be used on table elements, it may give unexpected results on tables using the <code>border-collapse: collapse</code> CSS property.</p>
<figure>
<img src="/resources/0042_04_06.png"/>
Expand Down Expand Up @@ -45,6 +44,7 @@ $( "p:last" ).text(
<category slug="manipulation/style-properties"/>
<category slug="version/1.2.6"/>
</entry>

<entry type="method" name="outerWidth" return="jQuery">
<signature>
<added>1.8.0</added>
Expand Down