up.fragment.isAlive(fragment)
JavaScript function
This feature is experimental. Please share your experiences so we know what to keep or change.
Returns whether the given fragment is both attached to the DOM and not currently in a destroy animation.
Understanding aliveness
A fragment that is alive can be targeted, and can be discovered by up.fragment functions.
A fragment becomes "unalive" immediately when it is destroyed, or when an ancestor is destroyed. If the destruction is animated, the fragment is "unalive" while the animation is still playing.
| Element state | up.fragment.isAlive(element) |
|---|---|
| Entered DOM | true |
| Enter animation playing | true |
| Still element in the DOM | true |
| Exit 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.Layer#isAlive()method checks if an overlay is attached to the DOM and also not in a closing animation.
Parameters
fragment
Return value
Whether the fragment (and its ancestors) are considered alive.
Type: boolean