Creates a copy of an Animation object.
Method of apis/web animations/Animationapis/web animations/Animation
Syntaxvar myMiniMe = myAnimation.clone();
Return Value
Returns an object of type
Return a new Animation object created by calling the Animation constructor with parameters Animation(source.target, cloned effect, cloned timing).
ExamplesThis example creates an instance of the AnimationPlayer that animates an object horizontally and vertically using computed values, and runs for 1500ms (1.5 seconds), and then creates a copy of the player for later use.
var player = snowFlake.animate([
{transform: 'translate(' + snowLeft + 'px, -100%)'},
{transform: 'translate(' + snowLeft + 'px, ' + window.innerHeight + 'px)'}
], 1500);
var player2 = player.clone();
Related specifications
Portions of this content come from HTML5Rocks! article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4