doc: Clarified units in Element.cumulativeOffset and added example.
This commit is contained in:
parent
c448b38f7b
commit
f1f6fca60b
|
@ -1124,10 +1124,24 @@ Element.Methods = {
|
|||
* Element.cumulativeOffset(@element) -> Array
|
||||
*
|
||||
* Returns the offsets of `element` from the top left corner of the
|
||||
* document.
|
||||
* document, in pixels.
|
||||
*
|
||||
* Returns an array in the form of `[leftValue, topValue]`. Also accessible
|
||||
* as properties: `{ left: leftValue, top: topValue }`.
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* Assuming the div `foo` is at (25,40), then:
|
||||
*
|
||||
* var offset = $('foo').cumulativeOffset();
|
||||
* offset[0];
|
||||
* // -> 25
|
||||
* offset[1];
|
||||
* // -> 40
|
||||
* offset.left;
|
||||
* // -> 25
|
||||
* offset.top;
|
||||
* // -> 40
|
||||
**/
|
||||
cumulativeOffset: function(element) {
|
||||
var valueT = 0, valueL = 0;
|
||||
|
|
Loading…
Reference in New Issue