Adjust fallback top/left to just be 0 for disconnected DOM nodes. Follow-up to cf672a2e7a, thanks to @jitter for the catch.

This commit is contained in:
John Resig 2010-09-29 05:45:52 -07:00
parent 49f6f34181
commit ec7ea3fba1

View file

@ -25,7 +25,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {
box = elem.getBoundingClientRect();
} catch(e) {
box = { top: elem.offsetTop, left: elem.offsetLeft };
box = { top: 0, left: 0 };
}
var doc = elem.ownerDocument,