const myElement = document.querySelector(".my-element");
// ...
function handleVT() {
const vt = myElement.startViewTransition(() => {
updateDOMSomehow();
});
}
// Returns a reference to vt if the transition is still ongoing
myElement.activeViewTransition;Element: activeViewTransition property / notebook
Element: activeViewTransition property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.