Home :: Tutorials :: SVG :: Events

Begin and End Events

<rect y="20" width="10" height="10" fill="red">
    <animate attributeName="x" values="0;40" begin="click" dur="2s"
             onbegin="advance(evt, 'Running')"
             onend="advance(evt, 'Stopped')"/>
</rect>

Repeat Event

<rect y="20" width="10" height="10" fill="red">
    <animate attributeName="x" values="0;40" dur="3s"
             repeatCount="indefinite"
             onrepeat="advance(evt)"/>
</rect>