Hi David.

ddailey:
> Does someone know if one can trigger a JavaScript function when a SMIL
> animation terminates? Basically, I'd like a moving object to remove
> itself from the SVG DOM when its animation completes.
>
> I thought I had done this once but if I did it is now forgotten.

Yes you can do this by attaching an event handler to the SMIL endEvent
event.  Try:

  <svg xmlns="http://www.w3.org/2000/svg";>
    <circle cx="100" cy="100" r="100">
      <animate attributeName="r" to="50" begin="2s" dur="3s"
               onend="c = evt.target.parentNode;
                      c.parentNode.removeChild(c)"/>
    </circle>
  </svg>

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
        xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]


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