Compare Revisions

Element.getBoundingClientRect()

Revision 13537:

Revision 13537 by Shelby on

Revision 13538:

Revision 13538 by Jacobian on

Title:
element.getBoundingClientRect
element.getBoundingClientRect
Slug:
DOM/element.getBoundingClientRect
DOM/element.getBoundingClientRect
Tags:
DOM, Gecko, "Gecko DOM Reference", NeedsCompatTable, MakeBrowserAgnostic
DOM, Gecko, "Gecko DOM Reference", NeedsCompatTable, MakeBrowserAgnostic
Content:

Revision 13537
Revision 13538
n26      The returned value is a <a href="/en/nsIDOMClientRect" titln26      The returned value is a <a href="/en/XPCOM_Interface_Refere
>e="en/nsIDOMClientRect">TextRectangle</a> object which is the uni>nce/nsIDOMClientRect" title="en/nsIDOMClientRect">TextRectangle</
>on of the rectangles returned by <code>getClientRects()</code> fo>a> object which is the union of the rectangles returned by <code>
>r the element, i.e., the CSS border-boxes associated with the ele>getClientRects()</code> for the element, i.e., the CSS border-box
>ment.>es associated with the element.
t46      For cross-browser compatibility, use&nbsp;<code>window.paget46      For cross-browser compatibility, use&nbsp;<code>window.page
>XOffset</code> and&nbsp;<code>window.pageYOffset</code>&nbsp;inst>XOffset</code> and&nbsp;<code>window.pageYOffset</code>&nbsp;inst
>ead of&nbsp;<code style="color: inherit; font-weight: inherit;">w>ead of&nbsp;<code style="color: inherit; font-weight: inherit;">w
>indow.scrollX</code>&nbsp;and&nbsp;<code style="color: inherit; f>indow.scrollX</code>&nbsp;and&nbsp;<code style="color: inherit; f
>ont-weight: inherit;">window.scrollY</code>, except use <code>(((>ont-weight: inherit;">window.scrollY</code>, except use <code>(((
>t = document.documentElement) || (t = document.body.parentNode)) >t = document.documentElement) || (t = document.body.parentNode)) 
>&amp;&amp; typeof t<span class="Apple-style-span" style="font-fam>&amp;&amp; typeof t<span class="Apple-style-span" style="font-fam
>ily: monospace;">.ScrollLeft</span> == 'number' ? t : document.bo>ily: monospace;">.ScrollLeft</span> == 'number' ? t : document.bo
>dy).ScrollLeft</code> and&nbsp;<span class="Apple-style-span" sty>dy).ScrollLeft</code> and <code><span class="Apple-style-span" st
>le="font-family: monospace;">(((t = document.documentElement) || >yle="font-family: monospace;">(((t = document.documentElement) ||
>(t = document.body.parentNode)) &amp;&amp; typeof t<span class="A> (t = document.body.parentNode)) &amp;&amp; typeof t<span class="
>pple-style-span" style="font-family: monospace;">.</span></span><>Apple-style-span" style="font-family: monospace;">.</span></span>
>span class="Apple-style-span" style="font-family: monospace;">Scr><span class="Apple-style-span" style="font-family: monospace;">Sc
>ollTop</span><span class="Apple-style-span" style="font-family: m>rollTop</span><span class="Apple-style-span" style="font-family: 
>onospace;">== 'number' ? t : document.body)</span><code>.ScrollTo>monospace;">== 'number' ? t : document.body)</span>.ScrollTop</co
>p</code> when&nbsp;<code style="color: inherit; font-weight: inhe>de> when&nbsp;<code style="color: inherit; font-weight: inherit;"
>rit;">window.pageXOffset</code>&nbsp;and&nbsp;<code>window.pageYO>>window.pageXOffset</code>&nbsp;and&nbsp;<code>window.pageYOffset
>ffset (and</code> <code style="color: inherit; font-weight: inher> (and</code> <code style="color: inherit; font-weight: inherit;">
>it;">window.pageXOffset</code>&nbsp;and&nbsp;<code style="color: >window.pageXOffset</code>&nbsp;and&nbsp;<code style="color: inher
>inherit; font-weight: inherit;">window.pageYOffset</code><code>)<>it; font-weight: inherit;">window.pageYOffset</code><code>)</code
>/code> are undefined.>> are undefined.

Back to History