Performs an animated transition between the source
and target
elements.
Transitions are implement by performing two animations in parallel,
causing source
to disappear and the target
to appear.
target
is inserted before source
source
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 target
.source
and target
are animated in parallelsource
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
The target element that will remain in the DOM once the transition finished.
It should be detached before calling up.morph()
.
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.
Whether to reveal the new element by scrolling its parent viewport.
A promise that fulfills when the transition ends.