博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
小程序animation动画效果综合应用案例(交流QQ群:604788754)
阅读量:7086 次
发布时间:2019-06-28

本文共 1714 字,大约阅读时间需要 5 分钟。

如果案例有问题,可到QQ群找到今日相关压缩文件下载测试。

WXML:

电话
发布
咨询

WXSS:

.cebian {  width: 50px;  height: auto;  display: flex;  flex-direction: column;  position: fixed;  bottom: 60px;  right: 20px;  z-index: 10;  overflow: hidden;}.anniu{  position: relative;  left: 50px;}.cebian01, .cebian02,.cebian03,.cebian04 {  height: 50px;  width: 50px;  text-align: center;  line-height: 50px;  border-radius: 60px;  color: #fff;}.cebian02,.cebian03,.cebian04{  margin-top: 10px;}.cebian01{  background-color: #50cb67;}.cebian02{  background-color: #6785e5;}.cebian03{  background-color: #ec4149;}.cebian04{  background-color: #949494;  position: relative;}.cebian04>image{  width: 30px;  height: 30px;  position: relative;  top: 10px;  }

JS:

Page({  data: {    jiantous: false,    anniuimg: '/picture/jiantou01.png',  },  /*右侧按钮部分效果*/  onReady: function () {    this.animation = wx.createAnimation();    this.animations = wx.createAnimation()  },  anniuhide: function () {    var leftjian = this.data.jiantous;    if (leftjian == false) {      this.animation.translate(50, 0).step();      this.animations.rotate(180).translate(3,0).step();      leftjian = true;    } else {      this.animation.translate(0, 0).step();      this.animations.rotate(0).translate(0, 0).step();      leftjian = false;    }    this.setData({      animation: this.animation.export(),      animations: this.animations.export(),      jiantous: leftjian,    });  },})

效果图:

转载于:https://www.cnblogs.com/yiweiyihang/p/7119540.html

你可能感兴趣的文章
用友软件操作流程(新建年度帐、年度结转步骤
查看>>
程序员
查看>>
杭州某公司技术一面
查看>>
我的友情链接
查看>>
在word里面写完文章在里面添加本机的图标
查看>>
我的友情链接
查看>>
cp: omitting directory `foldera/'
查看>>
linux中磁盘配置
查看>>
自动编译脚本编写指南
查看>>
PLSQL_两表之间的相互操作
查看>>
针对于 welcome-file-list 不生效的解决办法
查看>>
缓存框架:EhCache
查看>>
Java连接池总结复习及推荐
查看>>
关于CSS制作水平/垂直居中对齐问题
查看>>
Java生成SM2证书基于BouncyCastle(cer)
查看>>
Tornado的Mongodb异步操作—Motor
查看>>
VC/MFC子窗体向父窗体传递参数的几种方法
查看>>
Docker Storage Driver 改为 devicemapper
查看>>
libjson c binary的安装步骤
查看>>
dexpot windows实用软件
查看>>