Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Chrome page transitions

async function spaNavigate(data) {
  // Fallback
  if (!document.createDocumentTransition) {
    await updateTheDOMSomehow(data);
    return;
  }

  // With a transition
  const transition = document.createDocumentTransition();
  await transition.start(() => updateTheDOMSomehow(data));
  console.log("Transition complete!");
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #Chrome #page #transitions
ADD COMMENT
Topic
Name
4+2 =