I've embedded a <div>
in a <svg>
using <foreignObject>
. I want to <animate>
its CSS attribute opacity, fading it in when the page has loaded. So I specified an XLink locator, referring to the target element to be animated:
<g xmlns:xlink="http://www.w3.org/1999/xlink">
<animate xlink:href="#animateThis" attributeType="CSS" attributeName="opacity" from="0" to="1" begin="0s" dur="1s" fill="freeze" />
</g>
<foreignObject>
<body xmlns="http://www.w3.org/1999/xhtml">
<div id="animateThis" style="opacity:0">
The quick brown fox jumps over the lazy dog.
</div>
</body>
</foreignObject>
(The svg is embedded in a HTML5 document).
Testing it in chrome, It doesn't work. On native svg elements however, it does. How do I make this work in objects embedded with <foreignObject>
?