W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2000

Re: Mouse events - coordinate systems

From: <Boris.Motik@trilogy.com>
Date: Fri, 23 Jun 2000 10:43:43 -0500
To: keshlam@us.ibm.com
Cc: www-dom@w3.org
Message-ID: <OF4815E79E.11588F68-ON86256907.0051957B@trilogy.com>

I understand that the display of elements does not need to be cleanly
nested visually. However, this doesn't mean that DOM implementation could
supply coordinates of mouse evvents in coordinate system of the target
element. To be able to do so one should simply subtract the sum of all
offsets of the top left point of all ancestor elements. In that way DOM
users could work with coordinate systems that have origins at the top left
corner of each box.

Also, Netscape and IE support this (although in an incompatihle way).

Sincerely yours

     Boris Motik

                    m.com                To:     Boris.Motik@trilogy.com                                                        
                                         cc:     www-dom@w3.org                                                                 
                    22.06.2000           Subject:     Re: Mouse events - coordinate systems                                     

>However, it would be very useful to have something linke offsetX, offsetY
>that would show mouse coordinates relative to the origin of the element
>(e.g. a DIV element) within which the event occured.

You may be able to extract that information using the DOM Level 3 "Views"
features, when that becomes available. It's _NOT_ a simple problem;
remember that there's nothing which obligates the displayed form of
elements to be cleanly nested, or even contiguous,

Joe Kesselman  / IBM Research
Received on Friday, 23 June 2000 11:46:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:07 UTC