Whoops. Not sure why the partial send. Apologies to group. Lets try again
There appears to be a bug in getElementPosition. At the top of the function is
if (elem.x && elem.y) {
/* it's just a MochiKit.Style.Coordinates
object */
It seems like ( in Firefox at any rate ) several normal DOM elements have x and y attributes. At least one of these is generally set to 0, so the && test fails and there aren't any problems. However on some floating elements this is not true and the wrong result is returned.
My poor workaround is to add isUndefinedOrNull(elem.nodeType) to the test to try and eliminate the false matches. I'm not sure what the original intent of supporting arbitrary positioning using x and y attributes was though - is there a better way to detect this?
Hamish Friedlander
www.mindcontroldogs.com
www.indonesiawild.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---
- [mochikit] Bug in getElementPosition Hamish Friedlander
- [mochikit] Bug in getElementPosition Hamish Friedlander
- [mochikit] Re: Bug in getElementPosition Beau Hartshorne
- [mochikit] Re: Bug in getElementPosition Beau Hartshorne
