This project is archived and is in readonly mode.

#355 ✓resolved
Aaron Newton

getOffsetParent issue with nested tables

Reported by Aaron Newton | September 2nd, 2008 @ 08:22 PM | in 1.3.1 (closed)

If you have a table2 inside a table1, FF3 (perhaps others) will report that table2.offsetParent is the td containing it:


table1
  tr
    td   << FF3 says this is offsetParent, even if pos == static
      table2

I suppose this means that we need to test, in FF3, that element.offsetParent is indeed positioned and, if it isn't, go through the same loop that IE uses. Something like:


	getOffsetParent: function(){
		var element = this;
		if (isBody(element)) return null;
		//here's the changed line:
		if (!Browser.Engine.trident && styleString(element.offsetParent, 'position') != 'static') return element.offsetParent;
		while ((element = element.parentNode) && !isBody(element)){
			if (styleString(element, 'position') != 'static') return element;
		}
		return null;
	},

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Referenced by

Pages