Search code examples
javascriptsvgwebkitsvg-animate

SVG animateTransform does not start


I was writing a piece of SVG code and ran into the following issue:

The animateTransform tag won't work (cannot start the animation) if the SVG isn't appended to the document with the window onload event.

Example: http://jsfiddle.net/r4WEh/ vs http://jsfiddle.net/r4WEh/1/

The only difference being:

init();

vs

window.onclick = init;

In the first one the svg is added to the dom with the window onload event. In the second one the svg is added to the dom on a mouseclick event.

Any help will be appreciated!


Solution

  • Works perfectly on Firefox. If you're using Safari or Chrome you're probably suffering from this bug