WeChat Mini Program API Animation


wx.createAnimation(OBJECT)


Create an animation instance animation. Call the instance's methods to describe the animation. Finally, the animation data is exported through the export method of the animation instance and passed to the animation property of the component.

Note: export Each time the method is called, the previous animation operation will be cleared

OBJECT parameter description:

QQ截图20170208132508.png

var animation = wx.createAnimation({
  transformOrigin:"50% 50%",
  duration:1000,
  timingFunction:"ease",
  delay:0
})

animation


Animation instances can call the following methods to describe animations. After the call is completed, they will return themselves and support chains. How to write the call.

Style:

QQ截图20170208132521.png

Rotation:

QQ截图20170208132533.png

##Scale:

QQ截图20170208132545.png

Offset:

QQ截图20170208132556.png

Tilt:

QQ截图20170208132607.png

Matrix deformation:

QQ截图20170208132621.png

Animation Queue


After calling the animation operation method,

step() should be called to indicate the completion of a group of animations, which can be done in a group of animations Call any number of animation methods, all animations in a group of animations will start at the same time, and the next group of animations will not proceed until one group of animations is completed. step can pass in a configuration parameter similar to wx.createAnimation() to specify the configuration of the current group animation.

Example:

<view animation="{{animationData}}"></view>
rrree