Search...
pause( )
Pauses a timeline.
Description
Pauses a running timeline.
Note that when a timeline is created it is paused by default at the beginning of the timeline.
Syntax
function pause(): TimeLine
pause Parameters
This function does not take any parameters.
Was this helpful?
Pause a timeline
Copy Code
1import wixAnimationsFrontend from 'wix-animations-frontend';23let timeline = wixAnimationsFrontend.timeline();45// ...67timeline.pause();
Create buttons for controlling how a timeline is played
Copy Code
1import wixAnimationsFrontend from 'wix-animations-frontend';23let timeline = wixAnimationsFrontend.timeline(4 {5 "repeat": 3,6 "repeatDelay": 100,7 "yoyo": true8 }9);1011$w.onReady( function () {12 const myImage = $w("#myImage");1314 timeline15 .add( myImage, {16 "rotate": 360,17 "scale": .5,18 "duration": 100019 } )20 .add( myImage, {21 "opacity": 0,22 "duration": 100023 } );2425 $w("#playButton").onClick( () => {26 timeline.play();27 } );2829 $w("#reverseButton").onClick( () => {30 timeline.reverse();31 } );3233 $w("#pauseButton").onClick( () => {34 timeline.pause();35 } );3637 $w("#replayButton").onClick( () => {38 timeline.replay();39 } );40} );