Hi All,
   I am a SVG newbie. i just created following quite simple svg
document and expect when the mouse is clicking on rectangle 'test3', i
can get the rectangle 'test3' from event's target attribute. but the
actual result is either evt.target or evt.currentTarget always return 
rectangle 'test2' object. 

  could you explain why it always returns 'test3' instead of 'test2'?
thank you very much!


<svg viewBox="0 0 1024 768" width="100%" height="100%"
xmlns="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink"; zoomAndPan="disable"
xml:space="preserve">
  <script>
     <![CDATA[
     
        function showCoord(evt) {
          alert(evt.target.getAttribute("id") + " source:" +
evt.currentTarget.getAttribute("id") + " phase:" + evt.eventPhase );
          }
   ]]>
  </script>

<g id="canvas">
   <g id="xxxx">
       <rect id="test4" x="145" y="95" width="105" height="105"
style="fill:none"/>
       <rect id="test3" x="150" y="100" width="100" height="100"
fill="blue"/>
   </g>
   <rect id="test2" x="0" y="0" width="100%" height="100%"
onclick="showCoord(evt)" pointer-events="all"  style="fill:none"/>


</g>
</svg>


------------------------------------

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to