Reputation: 549
Recently was surfing about SVG's animate tags, and saw something like this:
<svg><animate href="#x" attributeName="href" values="https://www.google.com"/><a id="x"><circle r=100>
So, this will insert the <animate values>
into the <a>
tag as href
while rendering. So, when you click the circle animation, https://www.google.com is triggered.
The issue is, this href insertion doesn't work in Firefox. Works well in Chrome.
<a>
tag in Firefox? (The question is to achieve the dynamic insertion using SVG and not about the functionality)<a>'s href
attribute without directly specifying it.Upvotes: 0
Views: 481
Reputation: 124059
There seems to be a Firefox bug here:
I need to add a dummy href="" on the <a>
element to get it working.
I've raised a bug on Bugzilla and attached a patch that fixes the bug.
<svg><animate href="#x"
attributeName="href"
values="https://www.google.com"/><a href="" id="x"><circle r="100"/>
</a></svg>
If I do it the old fashioned xlink:href way I need a dummy xlink:href value instead.
<svg><animate href="#x"
attributeName="xlink:href"
values="https://www.google.com"/><a xlink:href="" id="x"><circle r="100"/>
</a></svg>
Upvotes: 1