resume()
Resumes the playback of a paused timer in its current direction.
Returns
The timer itself
Can be chained with other timer methods.
resume() code example
import { createTimer, utils } from 'animejs';
const [ $resumeButton, $pauseButton, $alternateButton ] = utils.$('.button');
const [ $time ] = utils.$('.time');
const timer = createTimer({
duration: 2000,
onUpdate: self => $time.innerHTML = self.iterationCurrentTime,
loop: true,
});
const resumeTimer = () => timer.resume();
const pauseTimer = () => timer.pause();
const alternateTimer = () => timer.alternate();
$resumeButton.addEventListener('click', resumeTimer);
$pauseButton.addEventListener('click', pauseTimer);
$alternateButton.addEventListener('click', alternateTimer);
<div class="large centered row">
<div class="half col">
<pre class="large log row">
<span class="label">iteration time</span>
<span class="time value lcd">0</span>
</pre>
</div>
</div>
<div class="medium row">
<fieldset class="controls">
<button class="button">Resume</button>
<button class="button">Pause</button>
<button class="button">Alternate</button>
</fieldset>
</div>