Take a look at the following; it lets different events on parts of the group be 
registered and responded to.

 

Hope it helps

David

 

<svg       xmlns="http://www.w3.org/2000/svg"; width="100%"

xmlns:xlink="http://www.w3.org/1999/xlink"; 

> 

<script><![CDATA[

xmlns="http://www.w3.org/2000/svg";

xlink="http://www.w3.org/1999/xlink"; 

function all(evt){

                

                if (evt.type=="click") alert(evt.target.nodeName)

                else 
evt.currentTarget.firstChild.nextSibling.setAttributeNS(null,"fill","red")

}

 

//]]>

</script>

<g onmousedown="all(evt);" onmouseup="all(evt)">

<circle onclick="all(evt)" fill="black" r="5" cx="55" cy="55"/>

<circle onclick="all(evt)" fill="black" r="5" cx="100" cy="100"/>

</g>

</svg>

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
jgfa92004
Sent: Wednesday, December 03, 2008 6:07 AM
To: [email protected]
Subject: [svg-developers] onmousedown() and onclick() at the same time

 

Hi,

I have the following svg code : 

<g onmousedown="down(evt);" onmouseup="up(evt);">
<circle onclick="alert('circle1')" fill="black" r="5" cx="5" cy="5"/>
<circle onclick="alert('circle2')" fill="black" r="5" cx="0" cy="0"/>
</g>

My problème is that the onclick event is never called, apparently 
because of the onmousedown and onmouseup events called in the first g.
What should I do to be able to call another function when a circle is 
clicked ?
Thanks a lot.

 



[Non-text portions of this message have been removed]


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

-----
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