Ticket #286 (new defect)

Opened 5 months ago

Last modified 3 months ago

MochiKit.Style.getElementPosition and offsetParents

Reported by: bob@redivi.com Assigned to: somebody
Priority: normal Milestone:
Component: component1 Version:
Severity: normal Keywords:
Cc: f.zindel@tudelft.nl, lalinsky@gmail.com

Description

There is a bug in the way MochiKit.Style.getElementPosition calculates positions for absolute positioned elements. i.e. it doesn't account for the offsetParents border.

In Style.js line 253: while (parent) {

c.x += parent.offsetLeft; c.y += parent.offsetTop; /* should add parent border here */ parent = parent.offsetParent;

}

I verified that YAHOO.util.Dom.getXY has the same problem and I filed a bug with them too.

Change History

04/07/08 01:00:56 changed by cederberg@gmail.com

  • cc changed from f.zindel@tudelft.nl to f.zindel@tudelft.nl, lalinsky@gmail.com.

See #300 for a similar issue with an example and code to fix the issue attached.