ViewTransition: skipTransition()-Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die skipTransition()
-Methode der
ViewTransition
-Schnittstelle überspringt den Animationsanteil der Ansichtsübertragung, führt jedoch das zugehörige Ansichtsupdate weiterhin aus.
Syntax
js
skipTransition()
Parameter
Keine.
Rückgabewert
undefined
.
Beispiele
Überspringen einer SPA-Ansichtsübertragung
js
// start new view transition
const transition = document.startViewTransition(() => displayNewImage());
// skip the animation and just update the DOM
transition.skipTransition();
Überspringen einer MPA-Ansichtsübertragung
js
// Fired on the current (outgoing) page
document.addEventListener("pageswap", (event) => {
event.viewTransition?.skipTransition();
});
// Fired on the destination (inbound) page
document.addEventListener("pagereveal", (event) => {
event.viewTransition?.skipTransition();
});
Spezifikationen
Specification |
---|
CSS View Transitions Module Level 1 # dom-viewtransition-skiptransition |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
skipTransition |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.