W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: [cssom] Element size/positioning information

From: Gérard Talbot <www-style@gtalbot.org>
Date: Mon, 11 Apr 2011 19:57:11 -0700
Message-ID: <b07d58aec4f65060ac0cb3cb2445234b.squirrel@cp3.shieldhost.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: "www-style list" <www-style@w3.org>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:39 GMT