How to implement delay in infinite animation?
<svg> <circle id="green" r="19" cx="50" cy="50" fill="green" fill-opacity=".82"/> <animate xlink:href="#green" attributeName="r" from="19" to="30" dur="3s" begin="3s;green.end+5s"/> </svg> How to implement delay in infinite animation?
<svg> <circle id="green" r="19" cx="50" cy="50" fill="green" fill-opacity=".82"/> <animate xlink:href="#green" attributeName="r" from="19" to="30" dur="3s" begin="3s;green.end+5s"/> </svg> Infinite animation to increase the radius of a circle.
Achieved by using the parameter repeatCount="indefinite"
The radius value is values="19;30"
Start of animation - click on the figure
<svg id="svg2"> <circle id="green" r="19" cx="50" cy="50" fill="green" fill-opacity=".82"/> <animate id="anim-stroke" xlink:href="#green" attributeName="r" values="19;30" dur="5s" begin="svg2.click" repeatCount="indefinite"/> </svg> values="19;30;19"
<svg id="svg2"> <circle id="green" r="19" cx="50" cy="50" fill="green" fill-opacity=".82"/> <animate id="anim-stroke" xlink:href="#green" attributeName="r" values="19;30;19" dur="5s" begin="svg2.click" repeatCount="indefinite"/> </svg> Pause in the initial and final state of the circle
values="19;30;30;19;19" <svg id="svg2"> <circle id="green" r="19" cx="50" cy="50" fill="green" fill-opacity=".82"/> <animate id="anim-stroke" xlink:href="#green" attributeName="r" values="19;30;30;19;19" dur="5s" begin="svg2.click" repeatCount="indefinite"/> </svg> The pause is achieved by repeating the values in the values parameter.
Simple arithmetic: the duration of the entire animation - 5 seconds. So pauses will be for 1 sec.
Source: https://ru.stackoverflow.com/questions/903860/
All Articles