Platinum sponsors

muted NEW

Disables the value updates, the callbacks and the completion promise of a timeline, while keeping its timing.

A muted timeline runs like the others: it begins, loops and completes at the same times, so the timing of a timeline does not change when a child is muted, but it writes nothing and calls nothing.

Accepts

Boolean

Default

false

muted is set at creation and cannot change afterwards: recreate the timeline to mute or unmute it.

The children of a muted timeline are muted too. A single child can be muted with its own muted parameter, or through the timeline defaults.

createTimeline({ defaults: { muted: true } })
  .add(target, { x: 100 })
  .add(target, { y: 100, muted: false }); // Overrides the default

muted code example

import { createTimeline } from 'animejs';

createTimeline({ loop: true, alternate: true })
  .add('.square-a', { x: '17rem' })
  .add('.square-b', { x: '17rem', muted: true }, 0)
  .add('.square-c', { x: '17rem' }, 0);
<div class="medium row">
  <div class="square square-a"></div>
  <div class="padded label">muted: false</div>
</div>
<div class="medium row">
  <div class="square square-b"></div>
  <div class="padded label">muted: true</div>
</div>
<div class="medium row">
  <div class="square square-c"></div>
  <div class="padded label">muted: false</div>
</div>
Previous
Next