Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can merge the two paths into one by concatenating the values of the <code>d</code> attributes:</p> <pre><code>&lt;path d="M52.25,14c0.25,2.28-0.52,3.59-1.8,5.62c-5.76,9.14-17.9,27-39.2,39.88M54.5,19.25c6.73,7.3,24.09,24.81,32.95,31.91c2.73,2.18,5.61,3.8,9.05,4.59" style="fill:none;stroke:black;stroke-width:2" /&gt; </code></pre> <p>Since it has two M elements, it will start your animation twice. If you want to merge into into a single continuous path, try:</p> <pre><code>&lt;path d="M11.25 59.5C32.55 46.62 44.69 28.76 50.45 19.62C51.73 17.59 52.5 16.28 54.5 19.25 C61.23 26.55 78.59 44.06 87.45 51.16C90.18 53.34 93.06 54.96 96.5 55.75" style="fill:none;stroke:black;stroke-width:2"&gt; &lt;animate attributeName="stroke-dasharray" values="0,200;200,200" begin="0s" dur="5s" /&gt;&lt;/path&gt; </code></pre> <p>EDIT:</p> <p>OK I think I see what you want now. I don't think it will work using a single path with multiple M commands as they cause new dash-arrays to start and that will affect your animation. You could try using the single joined path and then drawing white boxes over the bits you don't want, but that's hardly ideal.</p> <p>This sort of gets the effect I think you're after:</p> <pre><code>&lt;svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"&gt; &lt;path d="M52.25,14c0.25,2.28-0.52,3.59-1.8,5.62c-5.76,9.14-17.9,27-39.2,39.88" style="fill:none;stroke:black;stroke-width:2"&gt; &lt;animate id="animate1" attributeName="stroke-dasharray" from="0,60" to="60,60" begin="0s" dur="5s"/&gt;&lt;/path&gt; &lt;path d="M54.5,19.25c6.73,7.3,24.09,24.81,32.95,31.91c2.73,2.18,5.61,3.8,9.05,4.59" style="fill:none;stroke:black;stroke-width:2;stroke-dasharray:0,80"&gt; &lt;animate attributeName="stroke-dasharray" from="0,80" to="80,80" begin="animate1.end" dur="5s" fill="freeze"/&gt;&lt;/path&gt; &lt;/svg&gt; </code></pre> <p>It's also not ideal as you will need to change the length of the dash array depending on the length of the line. I've reduced it to 60 otherwise there's a big pause between when one animation starts and the other finishes (or rather, there isn't, but it looks like there is because it's continuing to increase the length of the dashes even though the dash already fills the line).</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.
    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