Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. ViewTransition
  4. skipTransition()

ViewTransition: skipTransition() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

TheskipTransition() method of theViewTransition interface skips the animation part of the view transition, but doesn't skip running the associated view update.

Syntax

js
skipTransition()

Parameters

None.

Return value

undefined.

Examples

Skipping an SPA view transition

js
// start new view transitionconst transition = document.startViewTransition(() => displayNewImage());// skip the animation and just update the DOMtransition.skipTransition();

Skipping an MPA view transition

js
// Fired on the current (outgoing) pagedocument.addEventListener("pageswap", (event) => {  event.viewTransition?.skipTransition();});// Fired on the destination (inbound) pagedocument.addEventListener("pagereveal", (event) => {  event.viewTransition?.skipTransition();});

Specifications

Specification
CSS View Transitions Module Level 1
# dom-viewtransition-skiptransition

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp