I want to make complex animation timeline in my svg. For example, I have 3 rectangles, and I want to show them sequentially and than restart animation.
Here it is: http://jsbin.com/opuguh/3/edit
More complex, and my ultimate target is to have quads shown like this
seconds 0 1 2
quad 1 inline inline none
quad 2 none inline inline
quad 3 inline none inline
so always display 2 quads, each second one of them disappearing for a second. But they should not be dependent on each other. Is there a way to do it?
If I put it in other way:
- quad1: start at 0s, display for 2s
- quad2: start at 1s, display for 2s
- quad3: start at 2s, display for 1s
- quad3: start at 0s, display for 1s
- repeat everything when time reaches 4s
I found answer myself. Trick is using
keyTimes, Set it to"0;{start};{end};1", where{start}and{end}are time fraction when you want to show or hide element (timeInSeconds/duration). In this way, all of them are independent, kind of like a timeline 🙂