@@ 8954-8989 (lines=36) @@ | ||
8951 | }; |
|
8952 | ||
8953 | jQuery.fn.extend({ |
|
8954 | offset: function( options ) { |
|
8955 | if ( arguments.length ) { |
|
8956 | return options === undefined ? |
|
8957 | this : |
|
8958 | this.each(function( i ) { |
|
8959 | jQuery.offset.setOffset( this, options, i ); |
|
8960 | }); |
|
8961 | } |
|
8962 | ||
8963 | var docElem, win, |
|
8964 | elem = this[ 0 ], |
|
8965 | box = { top: 0, left: 0 }, |
|
8966 | doc = elem && elem.ownerDocument; |
|
8967 | ||
8968 | if ( !doc ) { |
|
8969 | return; |
|
8970 | } |
|
8971 | ||
8972 | docElem = doc.documentElement; |
|
8973 | ||
8974 | // Make sure it's not a disconnected DOM node |
|
8975 | if ( !jQuery.contains( docElem, elem ) ) { |
|
8976 | return box; |
|
8977 | } |
|
8978 | ||
8979 | // If we don't have gBCR, just use 0,0 rather than error |
|
8980 | // BlackBerry 5, iOS 3 (original iPhone) |
|
8981 | if ( typeof elem.getBoundingClientRect !== strundefined ) { |
|
8982 | box = elem.getBoundingClientRect(); |
|
8983 | } |
|
8984 | win = getWindow( doc ); |
|
8985 | return { |
|
8986 | top: box.top + win.pageYOffset - docElem.clientTop, |
|
8987 | left: box.left + win.pageXOffset - docElem.clientLeft |
|
8988 | }; |
|
8989 | }, |
|
8990 | ||
8991 | position: function() { |
|
8992 | if ( !this[ 0 ] ) { |
@@ 9564-9595 (lines=32) @@ | ||
9561 | }; |
|
9562 | ||
9563 | jQuery.fn.extend( { |
|
9564 | offset: function( options ) { |
|
9565 | if ( arguments.length ) { |
|
9566 | return options === undefined ? |
|
9567 | this : |
|
9568 | this.each( function( i ) { |
|
9569 | jQuery.offset.setOffset( this, options, i ); |
|
9570 | } ); |
|
9571 | } |
|
9572 | ||
9573 | var docElem, win, |
|
9574 | elem = this[ 0 ], |
|
9575 | box = { top: 0, left: 0 }, |
|
9576 | doc = elem && elem.ownerDocument; |
|
9577 | ||
9578 | if ( !doc ) { |
|
9579 | return; |
|
9580 | } |
|
9581 | ||
9582 | docElem = doc.documentElement; |
|
9583 | ||
9584 | // Make sure it's not a disconnected DOM node |
|
9585 | if ( !jQuery.contains( docElem, elem ) ) { |
|
9586 | return box; |
|
9587 | } |
|
9588 | ||
9589 | box = elem.getBoundingClientRect(); |
|
9590 | win = getWindow( doc ); |
|
9591 | return { |
|
9592 | top: box.top + win.pageYOffset - docElem.clientTop, |
|
9593 | left: box.left + win.pageXOffset - docElem.clientLeft |
|
9594 | }; |
|
9595 | }, |
|
9596 | ||
9597 | position: function() { |
|
9598 | if ( !this[ 0 ] ) { |