---
name: "up.motion.finish"
area: "API"
kind: "JavaScript function"
parent: "up.motion module"
url: "https://unpoly.com/api/up.motion.finish"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.motion module](https://unpoly.com/api/up.motion.md)</nav>

# up.motion.finish([element])

Completes [animations](https://unpoly.com/api/up.animate.md) and [transitions](https://unpoly.com/api/up.morph.md).

If called without arguments, all animations on the screen are completed. If given an element (or selector), animations on that element and its children are completed.

Animations are completed by jumping to the last animation frame instantly. Promises returned by animation and transition functions instantly settle.

Emits the [`up:motion:finish`](https://unpoly.com/api/up:motion:finish.md) event that is handled by [`up.animate()`](https://unpoly.com/api/up.animate.md).

Does nothing if there are no animations to complete.

---

## Parameters {#parameters}

### [element] {#element}

(optional)

The element around which to finish all animations.

Type: [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) | [jQuery](https://learn.jquery.com/using-jquery-core/jquery-object/) | string

---

## Return value {#return-value}

A promise that fulfills when animations and transitions have finished.

Type: [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)

