How to implement animation in WeChat applet
Jun 09, 2018 pm 01:41 PMThis article mainly introduces the method of realizing animation animation in WeChat applet in detail. It has certain reference value. Interested friends can refer to
WeChat applet implements animation animation for details. The content is as follows
1. Create an animation instance
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: The export method will clear the previous animation operation after each call.
Animation queue
After calling the animation operation method, Call step() to indicate the completion of a group of animations. You can call any number of animation methods in a group of animations. All animations in a group of animations will start at the same time. 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. Animation execution can be called by binding animations to events.
The created animation instance can be described by calling the animation method. After the call is completed, it will return to itself, supporting chain call writing.
Within the same animation instance, you can define multiple motion forms and define multiple animations bound to different tags
Sample code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
2. Call animation execution
2.1 Bind animation
Bind the created animation instance to the corresponding tag
Sample code
1 2 |
|
2.2 Trigger animation
Calling animation execution through page events
Sample code:
1 |
|
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to implement verification code to obtain countdown effect through WeChat applet
ES6 iterator and for.of loop ( Detailed tutorial)
Using better-scroll scrolling plug-in in vue
The above is the detailed content of How to implement animation in WeChat applet. For more information, please follow other related articles on the PHP Chinese website!

Hot tools Tags

Hot Article

Hot tools Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to use CSS to achieve the rotating background animation effect of elements

Xianyu WeChat mini program officially launched

What is the name of Xianyu WeChat applet?

How to use PHP to develop the second-hand transaction function of WeChat applet?

Use WeChat applet to achieve carousel switching effect

WeChat applet implements image upload function

Implement the drop-down menu effect in WeChat applet

Implement image filter effects in WeChat mini programs
