diff --git a/entries/offset.xml b/entries/offset.xml index e626ac5a..9a588ca2 100644 --- a/entries/offset.xml +++ b/entries/offset.xml @@ -8,10 +8,10 @@ Get the current coordinates of the first element in the set of matched elements, relative to the document. -

The .offset() method allows us to retrieve the current position of an element relative to the document. Contrast this with .position(), which retrieves the current position relative to the offset parent. When positioning a new element on top of an existing one for global manipulation (in particular, for implementing drag-and-drop), .offset() is more useful.

+

The .offset() method allows us to retrieve the current position of an element (specifically its border box, which excludes margins) relative to the document. Contrast this with .position(), which retrieves the current position relative to the offset parent. When positioning a new element on top of an existing one for global manipulation (in particular, for implementing drag-and-drop), .offset() is more useful.

.offset() returns an object containing the properties top and left.

-

Note: jQuery does not support getting the offset coordinates of hidden elements or accounting for borders, margins, or padding set on the body element.

+

Note: jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <html> document element.

While it is possible to get the coordinates of elements with visibility:hidden set, display:none is excluded from the rendering tree and thus has a position that is undefined.

@@ -96,7 +96,7 @@ $( "*", document.body ).click(function( event ) { Set the current coordinates of every element in the set of matched elements, relative to the document. -

The .offset() setter method allows us to reposition an element. The element's position is specified relative to the document. If the element's position style property is currently static, it will be set to relative to allow for this repositioning.

+

The .offset() setter method allows us to reposition an element. The element's border-box position is specified relative to the document. If the element's position style property is currently static, it will be set to relative to allow for this repositioning.

Set the offset of the second paragraph: diff --git a/entries/position.xml b/entries/position.xml index 41bd0fb7..3eed46b4 100644 --- a/entries/position.xml +++ b/entries/position.xml @@ -6,10 +6,10 @@ Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. -

The .position() method allows us to retrieve the current position of an element relative to the offset parent. Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful.

+

The .position() method allows us to retrieve the current position of an element (specifically its margin box) relative to the offset parent (specifically its padding box, which excludes margins and borders). Contrast this with .offset(), which retrieves the current position relative to the document. When positioning a new element near another one and within the same containing DOM element, .position() is the more useful.

Returns an object containing the properties top and left.

-

Note: jQuery does not support getting the position coordinates of hidden elements or accounting for borders, margins, or padding set on the body element.

+

Note: jQuery does not support getting the position coordinates of hidden elements or accounting for margins set on the <html> document element.