Note that there are some explanatory texts on larger screens.

plurals
  1. POSVG <set> tag's dur attribute does not animate
    primarykey
    data
    text
    <p>I'm trying to animate a rollover using the SVG <code>&lt;set&gt;</code> tag, but even though I specify dur="1s", the transition is instantaneous (in Firefox, Safari, Opera, and Chrome).</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&gt; &lt;circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"&gt; &lt;set attributeType="CSS" attributeName="fill" to="green" begin="mouseover" end="mouseout" dur="1s" /&gt; &lt;/circle&gt; &lt;/svg&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I can achieve the effect that I want using two <code>&lt;animate&gt;</code> tags, but I want to be able to apply the transition to multiple elements that may have different initial colors that I want preserved (this method requires that I specify the initial color "red" in the second animate tag).</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&gt; &lt;circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"&gt; &lt;animate attributeType="CSS" attributeName="fill" to="green" begin="mouseover" dur="1s" fill="freeze" /&gt; &lt;animate attributeType="CSS" attributeName="fill" to="red" begin="mouseout" dur="1s" fill="freeze"/&gt; &lt;/circle&gt; &lt;/svg&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The <code>&lt;set&gt;</code> tag in the first code segment preserves the initial colors, but the transition is not animated. If my understanding of the w3 spec is correct, it should be - does this look like a browser-specific bug, or did I misunderstand the w3 spec? Is there a better way of going about this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload