up.Layer.prototype.isAlive()
Instance method
Returns whether this layer is part of the layer stack and can be interacted with.
When a layer is alive
A layer that is alive can be targeted with fragment changes, or queried for containing elements.
The root layer is always alive. An overlay is alive as soon as it enters the DOM, even when it is still playing its opening animation.
An overlay stops being alive as soon as it starts closing, even while its closing animation is still playing.
| Overlay state | up.Layer#isAlive() |
|---|---|
| Entered DOM | true |
| Opening animation playing | true |
| Opened | true |
| Closing animation playing | false |
| Removed from DOM | false |
See also
- The
.up-destroyingclass is automatically assigned to elements in their exit animation. - All
up.fragmentfunctions (likeup.fragment.get()) ignore elements in their exit animation. - The
up.fragment.isAlive()function checks if an element is attached to the DOM and also not in an exit animation.
Return value
Whether this layer is considered alive.
Type: boolean