Re: [cssom] Element size/positioning information

Le Lun 11 avril 2011 18:26, "Gérard Talbot" a écrit :
>
> Le Lun 11 avril 2011 14:35, Tab Atkins Jr. a écrit :
>
>
>
>
>
>
>> Mouse Positioning
>> =================

[snipped]

>> If you're
>> trying to find the position of the mouse relative to an element (for
>> example, if you're drawing something to a <canvas> where the mouse
>> is), you have to


[snipped]



> offsetX and offsetY properties seem to be what you are looking for here
> (and it is covered by CSSOM spec):
> reports/returns X/Y mouse coordinate within the target element
>
> http://www.gtalbot.org/DHTMLSection/WindowEventsNS6.html
>
> or
>
> http://www.gtalbot.org/DHTMLSection/PositioningEventOffsetXY.html
>
> (you'll need IE6+ or Opera 7+ to view this)

Tab,

Chrome 10.0.648.204 and Safari 4+  already supports offsetX and offsetY
event properties and without obvious bugs.

http://www.gtalbot.org/BrowserBugsSection/Opera11Bugs/Opera7BugOffsetXY.html

http://www.gtalbot.org/BrowserBugsSection/Opera11Bugs/Opera7EventOffsetXY.html

This demo page

http://www.gtalbot.org/DHTMLSection/WindowEventsNS6.html

does not show this but Chrome 10 and Safari 4+ should display offsetX and
offsetY property values as the mouse moves around in the page. That page
is old and has not been maintained for quite some time now.

Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Tuesday, 12 April 2011 02:57:43 UTC