aboutsummaryrefslogtreecommitdiffstats
path: root/src/offset.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-07-19 13:32:53 +0000
committerJohn Resig <jeresig@gmail.com>2009-07-19 13:32:53 +0000
commit48e9a3999596c2ee1f4470a78637de8f27e3b219 (patch)
tree8f4c68775a0645be21cce8d49cd6959d000bfb00 /src/offset.js
parent0d5c3a68a092401089c9242bdafdb1b2534feb6a (diff)
downloadjquery-48e9a3999596c2ee1f4470a78637de8f27e3b219.tar.gz
jquery-48e9a3999596c2ee1f4470a78637de8f27e3b219.zip
Standardize on using .nodeName in place of .tagName. Fixes jQuery bug #4923.
Diffstat (limited to 'src/offset.js')
-rw-r--r--src/offset.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/offset.js b/src/offset.js
index 6e22ce30e..3f616baa1 100644
--- a/src/offset.js
+++ b/src/offset.js
@@ -39,7 +39,7 @@ if ( "getBoundingClientRect" in document.documentElement ) {
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;
}
@@ -127,7 +127,7 @@ jQuery.fn.extend({
// 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
@@ -149,7 +149,7 @@ jQuery.fn.extend({
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;