Make sure that we don't attempt to handle scrolling when the node is disconnected from the document. Fixes #7190.
This commit is contained in:
parent
d490bcfa7c
commit
ea507b3e99
1 changed files with 9 additions and 6 deletions
|
@ -23,14 +23,17 @@ if ( "getBoundingClientRect" in document.documentElement ) {
|
|||
|
||||
try {
|
||||
box = elem.getBoundingClientRect();
|
||||
|
||||
} catch(e) {
|
||||
return { top: 0, left: 0 };
|
||||
}
|
||||
} catch(e) {}
|
||||
|
||||
var doc = elem.ownerDocument,
|
||||
body = doc.body,
|
||||
docElem = doc.documentElement,
|
||||
docElem = doc.documentElement;
|
||||
|
||||
// Make sure we're not dealing with a disconnected DOM node
|
||||
if ( !box || !jQuery.contains( docElem, elem ) ) {
|
||||
return box || { top: 0, left: 0 };
|
||||
}
|
||||
|
||||
var body = doc.body,
|
||||
win = getWindow(doc),
|
||||
clientTop = docElem.clientTop || body.clientTop || 0,
|
||||
clientLeft = docElem.clientLeft || body.clientLeft || 0,
|
||||
|
|
Loading…
Reference in a new issue