Performs an animated transition between two elements.
Transitions are implemented by performing two animations in parallel,
causing oldElement to disappear and newElement to appear.
newElement is inserted before oldElement
oldElement is removed from the document flow with position: absolute.
It will be positioned over its original place in the flow that is now occupied by newElement.oldElement and newElement are animated in paralleloldElement is removed from the DOMUnpoly ships with a number of predefined transitions.
You can define additional named transitions using up.transition().
Can either be:
up.transition())The duration of the transition, in milliseconds.
The timing function that controls the transition's acceleration.
See MDN documentation for a list of pre-defined timing functions.
A promise that fulfills when the transition ends.
Tip Your coding agent can search these docs locally with the Unpoly agent skill