AnimationEffect: updateTiming() メソッド

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2020.

updateTiming()AnimationEffect インターフェイスのメソッドで、アニメーション効果の指定した時刻プロパティを更新します。

構文

js
updateTiming(timing)

引数

timing 省略可

更新するタイミングプロパティを表す、AnimationEffect.getTiming() の返値に含まれるプロパティを 0 個以上格納したオブジェクトです。

返値

なし (undefined)。

例外

TypeError

タイミングプロパティのいずれかに不正な値が指定された場合に発生します。

副作用

updateTiming() は、関連する Animation の再生を開始または停止させることがあります。例えば、実行するアニメーションの効果が短くなり、その終了時刻が Animation.currentTime より前になる場合や、完成例のアニメーションの効果が長くなり、その終了時刻が Animation.currentTime より後になる場合です。

js
const animation = document.body.animate([], { duration: 1000 });
animation.finish();
console.log(animation.playState); // finished
animation.effect.updateTiming({ duration: 2000 });
console.log(animation.playState); // running

仕様書

Specification
Web Animations
# dom-animationeffect-updatetiming

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
updateTiming

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報