git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed offset(coordinates) returns null when no matching elements in jQuery object...
[jquery.git]
/
src
/
offset.js
diff --git
a/src/offset.js
b/src/offset.js
index
c318374
..
f80574e
100644
(file)
--- a/
src/offset.js
+++ b/
src/offset.js
@@
-2,16
+2,16
@@
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0];
jQuery.fn.offset = function( options ) {
var elem = this[0];
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
@@
-28,16
+28,16
@@
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0];
jQuery.fn.offset = function( options ) {
var elem = this[0];
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
+ if ( !elem || !elem.ownerDocument ) {
+ return null;
+ }
+
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}