- From: Arnold, Curt <Curt.Arnold@hyprotech.com>
- Date: Fri, 11 Jan 2002 17:04:40 -0700
- To: "'www-svg@w3.org'" <www-svg@w3.org>
Appendix B5:
Possible errata: is there an "outermost" missing in the first sentence.
clientX and clientY parameters for mouse events represent viewport
coordinates for the corresponding 'svg' element. relatedNode is the
corresponding outermost 'svg' element.
-----
Example:
The following example has nested <svg> elements. The text displayed by
mousing over the box do not seem to be affected by the presence of the
intermediate <svg> element (using Adobe SVG Viewer 3), specifically they are
not in the range of [1500,1500] to [2000,2000].
If "outermost" is not appropriate, how should intervening <svg> elements
affect the clientX and clientY coordinates.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="1000 1000 1000 1000">
<defs>
<script type="text/ecmascript">
var textNode =
document.getElementsByTagName("text").item(0).firstChild;
function mousemove(evt) {
textNode.nodeValue = "clientX=" +
evt.clientX.toString() + " clientY=" + evt.clientY.toString();
}
</script>
</defs>
<svg x="1500" y="1500" height="500" width="500" viewBox="10000 10000
10000 10000">
<rect x="10000" y="10000" height="10000" width="10000"
fill="beige" onmousemove="mousemove(evt)"/>
<text y="13000" x="11000" fill="red" font-size="1000">No
event yet</text>
</svg>
</svg>
Received on Friday, 11 January 2002 19:05:45 UTC