SVG elements will not Animate when added dynamically

人走茶凉 提交于 2019-12-01 11:17:23

问题


I have trying to achieve SVG element's animation while adding dynamic DOMs for its animation with jQuery. I generate DOMs with JS, so HTML page does not have any elements for this animation. When I add it dynamically, animation will not start in Chrome(16), however it works with FF(8)

The animation would perfect is I remove that dynamic doms which are generated with JS and put them static into HTML page.

I have created fiddle for it at : http://jsfiddle.net/cjP6K/7/

where I have put one svg dom static into HTML page, then I have cloned that element with jQuery on document ready, In this scene, the one which was added later with JS will not Animate at all !!(this works with FF)

Please help...

Thanks, Chetan.


回答1:


There is a chrome bug in the animateMotion tag, it has been an issue for ages..

refer to the bug report here http://code.google.com/p/chromium/issues/detail?id=13585

There isn't much that can be done to get around it in chrome while still maintaining an svg dom..

Hope this helps..



来源:https://stackoverflow.com/questions/8520493/svg-elements-will-not-animate-when-added-dynamically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!