Performs an animated transition between the
Transitions are implement by performing two animations in parallel,
source to disappear and the
target to appear.
targetis inserted before
sourceis removed from the document flow with
position: absolute. It will be positioned over its original place in the flow that is now occupied by
targetare animated in parallel
sourceis removed from the DOM
Unpoly ships with a number of predefined transitions.
You can define additional named transitions using
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:
The target element that will remain in the DOM once the transition finished.
It should be detached before calling
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.
Whether to reveal the new element by scrolling its parent viewport.
A promise that fulfills when the transition ends.