Re: Mouse events - coordinate systems

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



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



>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