--- layout: api title: "v2.1.8 JavaScript Library: L.PosAnimation" categories: api version: v2.1.8 permalink: /api/v2.1.8/l-posanimation ---

## PosAnimation

Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.

    var fx = new L.PosAnimation();
    fx.run(el, [300, 500], 0.5);

### Creation

Creation | Description
--- | ---
`new L.PosAnimation()` | Creates a PosAnimation object.

### Methods

Method | Returns | Description
--- | --- | ---
`run( <HTMLElement> element, <Point> newPos, <Number> duration?, <Number> easeLinearity? )` | `this` | Run an animation of a given element to a new position, optionally setting duration in seconds (`0.25` by default) and easing linearity factor (3rd argument of the cubic bezier curve, `0.5` by default)

### Events

You can subscribe to the following events using these methods.

Event | Data | Description
--- | --- | ---
`start` | `Event` | Fired when the animation starts.
`step` | `Event` | Fired continuously during the animation.
`end` | `Event` | Fired when the animation ends.