Photo Sphere Viewer
    Preparing search index...

    Class Animation<T>

    Interpolation helper for animations

    Implements the Promise API with an additional "cancel" method. The promise is resolved with true when the animation is completed and false if the animation is cancelled.

    const anim = new Animation({
    properties: {
    width: {start: 100, end: 200}
    },
    duration: 5000,
    onTick: (properties) => element.style.width = `${properties.width}px`;
    });

    anim.then((completed) => ...);

    anim.cancel();

    Type Parameters

    • T = any

      the type of interpolated properties

    Implements

    • PromiseLike<boolean>
    Index
    cancelled: boolean = false
    resolved: boolean = false
    • Promise chaining

      Type Parameters

      • U

      Parameters

      • OptionalonFulfilled: (complete: boolean) => U | PromiseLike<U>

        Called when the animation is complete (true) or cancelled (false)

      Returns Promise<U>