reset
[ Function ]
public reset(): this;
Resets the animation to the first keyframe. The CSS properties of the first keyframe are written to the style
attribute of the animated element, but animation-specific CSS is not removed from the DOM. This happens regardless of the values set by fillMode() or cleanup(), if the animation has not expired yet. When determining the first keyframe, however, the current animation direction is taken into account. Has no effect when the animation has expired and a cleanup has been performed.
If the animation is to be fast-forwarded to the endkeyframe, skip() can be used.
Parameter
Name | Type | Description |
---|---|---|
- | - | - |
Return value
Type | Description |
---|---|
This method returns its parent object to allow concatenation of method calls. |
Sample - JavaScript
var animation = new TcHmi.Animation('ViewDesktopBeckhoffLogo', '')
.addKeyframe('left', '20px', 0)
.addKeyframe('left', '520px', 1)
.duration(2000)
.run();
window.setTimeout(() => animation.reset(), 700);
Available from 1.8 |