resume() V4
Resumes the playback of a paused timeline in its current direction.
Returns
The timeline itself
Can be chained with other timeline methods.
resume() code example
import { creatTimeline, utils } from 'animejs';
const [ $pauseButton, $alternateButton, $resumeButton ] = utils.$('.button');
const tl = createTimeline({ loop: true })
.add('.circle', { x: '15rem' })
.add('.triangle', { x: '15rem' }, 500)
.add('.square', { x: '15rem' }, 1000);
const pauseTimeline = () => tl.pause();
const alternateTimeline = () => tl.alternate();
const resumeTimeline = () => tl.resume();
$pauseButton.addEventListener('click', pauseTimeline);
$alternateButton.addEventListener('click', alternateTimeline);
$resumeButton.addEventListener('click', resumeTimeline);
<div class="large row">
<div class="medium pyramid">
<div class="triangle"></div>
<div class="square"></div>
<div class="circle"></div>
</div>
</div>
<div class="medium row">
<fieldset class="controls">
<button class="button">Pause</button>
<button class="button">Alternate</button>
<button class="button">Resume</button>
</fieldset>
</div>