Animation.scaleZ
2020-08-21 16:01 更新
解释: 缩放 Z 轴
方法参数
Number sz
参数说明
在 Z 轴缩放 sz 倍数
示例
图片示例
代码示例
<view class="wrap">
<view class="animation-element-wrapper">
<view class="animation-element" animation="{{animation}}"></view>
</view>
<view class="card-area">
<view class="top-description border-bottom">展示动画</view>
<button type="primary" bindtap="scaleZ">scaleZ</button>
</view>
</view>
Page({
onLoad() {
this.animation = swan.createAnimation({
transformOrigin: '50% 50%',
duration: 1000,
timingFunction: 'ease',
delay: 0
});
},
scaleZ() {
let rotate = (Math.random() * 2).toFixed(2);
this.animation.scaleZ(rotate).step();
this.setData({animation: this.animation.export()});
swan.showToast({
title: 'z轴旋转角度为' + rotate,
icon: 'none'
});
}
});
以上内容是否对您有帮助:
更多建议: