Animation.scaleY

解释: 缩放 Y 轴

方法参数

Number sy, 在Y轴缩放sy倍数

示例

在开发者工具中预览效果

扫码体验

Animation.scaleY - 图1请使用百度APP扫码

图片示例

Animation.scaleY - 图2

Animation.scaleY - 图3

Animation.scaleY - 图4

代码示例

  1. <view class="wrap">
  2. <view class="animation-element-wrapper">
  3. <view class="animation-element" animation="{{animation}}"></view>
  4. </view>
  5. <view class="card-area">
  6. <view class="top-description border-bottom">展示动画</view>
  7. <button type="primary" bindtap="scaleY">scaleY</button>
  8. </view>
  9. </view>
  1. Page({
  2. data:{ },
  3. onReady() {
  4. this.animation = swan.createAnimation({
  5. transformOrigin: "50% 50%",
  6. duration: 1000,
  7. timingFunction: "ease",
  8. delay: 0})
  9. },
  10. scaleY() {
  11. this.animation.scaleY(Math.random() * 2).step()
  12. this.setData({animation: this.animation.export()})
  13. }
  14. });