Performs an animated transition between two elements.
Transitions are implement by performing two animations in parallel,
causing oldElement
to disappear and the 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()
.
During a transition both the old and new element occupy the same position on the screen.
Since the CSS layout flow will usually not allow two elements to overlay the same space, Unpoly:
display: hidden
visibility: hidden
Can either be:
up.transition()
)The duration of the animation, 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.