Parameters
Return Value
Returns an Animation object with chainable methods.Code Example
Related APIs
my.createLottieContext
Create Lottie animation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create an animation instance for element animations.
| Property | Type | Required | Description |
|---|---|---|---|
| duration | Integer | No | Animation duration in ms (default: 400) |
| timeFunction | String | No | Timing function: linear, ease, ease-in, ease-in-out, ease-out, step-start, step-end |
| delay | Integer | No | Animation delay in ms (default: 0) |
| transformOrigin | String | No | Transform origin (default: 50% 50% 0) |
const animation = my.createAnimation({
duration: 1000,
timeFunction: 'ease'
});
animation.scale(2).rotate(45).step();
this.setData({
animationData: animation.export()
});
<view animation="{{animationData}}">Animated content</view>