全网整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:400-708-3566

Android中微信小程序开发之弹出菜单

先给大家展示下效果图,具体效果图如下所示:

具体代码如下所示:

1.index.js

//index.js
//获取应用实例
var app = getApp()
Page({
 data: {
 isPopping: false,//是否已经弹出
 animationPlus: {},//旋转动画
 animationcollect: {},//item位移,透明度
 animationTranspond: {},//item位移,透明度
 animationInput: {},//item位移,透明度
 //我的博客:http://blog.csdn.net/qq_31383345
 //CSDN微信小程序开发专栏:http://blog.csdn.net/column/details/13721.html
 },
 onLoad: function () {
 },
 //点击弹出
 plus: function () {
 if (this.data.isPopping) {
 //缩回动画
 popp.call(this);
 this.setData({
 isPopping: false
 })
 } else {
 //弹出动画
 takeback.call(this);
 this.setData({
 isPopping: true
 })
 }
 },
 input: function () {
 console.log("input")
 },
 transpond: function () {
 console.log("transpond")
 },
 collect: function () {
 console.log("collect")
 }
})
//弹出动画
function popp() {
 //plus顺时针旋转
 var animationPlus = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 var animationcollect = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 var animationTranspond = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 var animationInput = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 animationPlus.rotateZ(180).step();
 animationcollect.translate(-100, -100).rotateZ(180).opacity(1).step();
 animationTranspond.translate(-140, 0).rotateZ(180).opacity(1).step();
 animationInput.translate(-100, 100).rotateZ(180).opacity(1).step();
 this.setData({
 animationPlus: animationPlus.export(),
 animationcollect: animationcollect.export(),
 animationTranspond: animationTranspond.export(),
 animationInput: animationInput.export(),
 })
}
//收回动画
function takeback() {
 //plus逆时针旋转
 var animationPlus = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 var animationcollect = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 var animationTranspond = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 var animationInput = wx.createAnimation({
 duration: 500,
 timingFunction: 'ease-out'
 })
 animationPlus.rotateZ(0).step();
 animationcollect.translate(0, 0).rotateZ(0).opacity(0).step();
 animationTranspond.translate(0, 0).rotateZ(0).opacity(0).step();
 animationInput.translate(0, 0).rotateZ(0).opacity(0).step();
 this.setData({
 animationPlus: animationPlus.export(),
 animationcollect: animationcollect.export(),
 animationTranspond: animationTranspond.export(),
 animationInput: animationInput.export(),
 })
}

2.index.wxml

<!--index.wxml-->
<image src="../../images/collect.png" animation="{{animationcollect}}" class="image-style" bindtap="collect"></image>
<image src="../../images/transpond.png" animation="{{animationTranspond}}" class="image-style" bindtap="transpond"></image>
<image src="../../images/input.png" animation="{{animationInput}}" class="image-style" bindtap="input"></image>
<image src="../../images/plus.png" animation="{{animationPlus}}" class="image-plus-style" bindtap="plus"></image>

3.index.wxss

/**index.wxss**/
.image-style {
 height: 150rpx;
 width: 150rpx;
 position: absolute;
 bottom: 250rpx;
 right: 100rpx;
 opacity: 0;
}
.image-plus-style {
 height: 150rpx;
 width: 150rpx;
 position: absolute;
 bottom: 250rpx;
 right: 100rpx;
 z-index: 100;
}

demo代码下载

以上所述是小编给大家介绍的Android中微信小程序开发之弹出菜单,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!


# 微信小程序菜单  # Android分享微信小程序失败的一些事小结  # 微信小程序—微信跳一跳  # Android游戏助手(外挂)使用教程详解  # 微信小程序开发之IOS和Android兼容的问题  # 性能分析:指如何快速定位SQL问题  # Android开发微信小程序页面的图文教程  # 弹出  # 所示  # 小编  # 程序开发  # 在此  # 给大家  # 所述  # 给我留言  # 感谢大家  # 先给  # 我的博客  # 顺时针  # 应用实例  # 疑问请  # 有任何  # csdn  # net  # animationTranspond  # item  # animationInput 


相关文章: 弹幕视频网站制作教程下载,弹幕视频网站是什么意思?  深圳网站制作的公司有哪些,dido官方网站?  如何通过cPanel快速搭建网站?  表情包在线制作网站免费,表情包怎么弄?  免费制作小说封面的网站有哪些,怎么接网站批量的封面单?  制作网站的软件免费下载,免费制作app哪个平台好?  沈阳个人网站制作公司,哪个网站能考到沈阳事业编招聘的信息?  如何在阿里云购买域名并搭建网站?  网站制作说明怎么写,简述网页设计的流程并说明原因?  如何在建站宝盒中设置产品搜索功能?  阿里云网站制作公司,阿里云快速搭建网站好用吗?  网站图片在线制作软件,怎么在图片上做链接?  在线教育网站制作平台,山西立德教育官网?  怎么制作一个起泡网,水泡粪全漏粪育肥舍冬季氨气超过25ppm,可以有哪些措施降低舍内氨气水平?  如何基于云服务器快速搭建网站及云盘系统?  如何撰写建站申请书?关键要点有哪些?  浅谈Javascript中的Label语句  如何在宝塔面板中修改默认建站目录?  北京制作网站的公司排名,北京三快科技有限公司是做什么?北京三快科技?  上海制作企业网站有哪些,上海有哪些网站可以让企业免费发布招聘信息?  黑客入侵网站服务器的常见手法有哪些?  制作表格网站有哪些,线上表格怎么弄?  保定网站制作方案定制,保定招聘的渠道有哪些?找工作的人一般都去哪里看招聘信息?  建站之星后台管理如何实现高效配置?  建站之星后台密码遗忘如何找回?  定制建站模板如何实现SEO优化与智能系统配置?18字教程  建站之星2.7模板:企业网站建设与h5定制设计专题  如何在Golang中实现微服务服务拆分_Golang微服务拆分与接口管理方法  广州建站公司哪家好?十大优质服务商推荐  Swift开发中switch语句值绑定模式  专业型网站制作公司有哪些,我设计专业的,谁给推荐几个设计师兼职类的网站?  javascript基本数据类型及类型检测常用方法小结  如何快速搭建个人网站并优化SEO?  C#怎么创建控制台应用 C# Console App项目创建方法  python的本地网站制作,如何创建本地站点?  如何用AWS免费套餐快速搭建高效网站?  广州网站制作公司哪家好一点,广州欧莱雅百库网络科技有限公司官网?  ui设计制作网站有哪些,手机UI设计网址吗?  建站之星在线版空间:自助建站+智能模板一键生成方案  建站之星导航菜单设置与功能模块配置全攻略  免费网站制作模板下载,除了易企秀之外还有什么H5平台可以制作H5长页面,最好是免费的?  ,柠檬视频怎样兑换vip?  广州网站制作的公司,现在专门做网站的公司有没有哪几家是比较好的,性价比高,模板也多的?  香港服务器租用费用高吗?如何避免常见误区?  枣阳网站制作,阳新火车站打的到仙岛湖多少钱?  实现虚拟支付需哪些建站技术支撑?  如何用虚拟主机快速搭建网站?详细步骤解析  网站海报制作教学视频教程,有什么免费的高清可商用图片网站,用于海报设计?  网站专业制作公司,网站编辑是做什么的?好做吗?工作前景如何?  头像制作网站在线观看,除了站酷,还有哪些比较好的设计网站? 

您的项目需求

*请认真填写需求信息,我们会在24小时内与您取得联系。