weex版本 >= 0.4
一系列的动画接口
linear
也可以是ease-in
、ease-out
、ease-in-out
、linear
、cubic-bezier(x1, y1, x2, y2)
其中之一.
x
px,y
px 或者关键字left
、right
、bottom
、top
、center
.
- <template>
- <div class="ct">
- <div id="test"></div>
- </div>
- </template>
- <script>
- module.exports = {
- ready: function () {
- var animation = require('@weex-module/animation');
- var testEl = this.$el('test');
- animation.transition(testEl, {
- styles: {
- color: '#FF0000',
- transform: 'translate(1, 1)'
- },
- duration: 0, //ms
- timingFunction: 'ease',
- 'transform-origin': 'center center', //中间有连字符,最好加上影号
- delay: 0 //ms
- }, function () {
- nativeLog('animation finished.')
- })
- }
- }
- </script>