git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
speed: committing a failing experiment of concat vs slice
[jquery.git]
/
src
/
offset.js
diff --git
a/src/offset.js
b/src/offset.js
index
6e22ce3
..
3f616ba
100644
(file)
--- a/
src/offset.js
+++ b/
src/offset.js
@@
-39,7
+39,7
@@
if ( "getBoundingClientRect" in document.documentElement ) {
top += elem.offsetTop;
left += elem.offsetLeft;
top += elem.offsetTop;
left += elem.offsetLeft;
- if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) {
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
@@
-127,7
+127,7
@@
jQuery.fn.extend({
// Get correct offsets
offset = this.offset(),
// Get correct offsets
offset = this.offset(),
- parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
+ parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
@@
-149,7
+149,7
@@
jQuery.fn.extend({
offsetParent: function() {
return this.map(function(){
var offsetParent = this.offsetParent || document.body;
offsetParent: function() {
return this.map(function(){
var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') === 'static') ) {
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, 'position') === 'static') ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent;
offsetParent = offsetParent.offsetParent;
}
return offsetParent;