Skip to content

API Cheat Sheet [timeline5]

bapquad edited this page Feb 23, 2022 · 3 revisions

Create new timeline for animation.

How to use

First, maybe you must be import the timeline5 module from package into your application.

import {timeline5} from '@bapquad/element5'

Functions

Create

Create a timeline, If timeline exists, it's find and return the exist timeline.

Parameter

  • options:object - A description object specifies the timeline. Required

Return

Returns the timeline object.

Example

import {element5 as $, timeline5} from '@bapquad/element5'

let timeline = timeline5.Create({
  name: "leftToRight", 
  keyframes:[
    {time: '0',   style: { transform: 'translateX( -100% )' }},
    {time: '100', style: { transform: 'translateX( 0% )' }},
  ]
});
let el = $("#aside");
el.Play(timeline);