国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

微信小程序實現彈出菜單

來源:懂視網 責編:小OO 時間:2020-11-27 22:11:16
文檔

微信小程序實現彈出菜單

本文實例為大家分享了微信小程序實現彈出菜單的具體代碼,供大家參考,具體內容如下:菜單;代碼。1.index.js。,//index.js//獲取應用實例var app = getApp()Page({ data: { isPopping: false,//是否已經彈出 animationPlus: {},//旋轉動畫 animationcollect: {},//item位移,透明度 animationTranspond: {},//item位移,透明度 animationInput: {},//item位移。2.index.wxml。
推薦度:
導讀本文實例為大家分享了微信小程序實現彈出菜單的具體代碼,供大家參考,具體內容如下:菜單;代碼。1.index.js。,//index.js//獲取應用實例var app = getApp()Page({ data: { isPopping: false,//是否已經彈出 animationPlus: {},//旋轉動畫 animationcollect: {},//item位移,透明度 animationTranspond: {},//item位移,透明度 animationInput: {},//item位移。2.index.wxml。

本文實例為大家分享了微信小程序實現彈出菜單的具體代碼,供大家參考,具體內容如下

菜單

代碼:

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代碼下載

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

微信小程序實現彈出菜單

本文實例為大家分享了微信小程序實現彈出菜單的具體代碼,供大家參考,具體內容如下:菜單;代碼。1.index.js。,//index.js//獲取應用實例var app = getApp()Page({ data: { isPopping: false,//是否已經彈出 animationPlus: {},//旋轉動畫 animationcollect: {},//item位移,透明度 animationTranspond: {},//item位移,透明度 animationInput: {},//item位移。2.index.wxml。
推薦度:
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 伊人久久精品成人网 | 久久网伊人 | 日本一区二区三区在线播放 | 国产99在线观看 | 欧美性一区二区三区五区 | 国产在线视频网 | 在线播放一区 | 在线欧美v日韩v国产精品v | 国产欧美一区二区三区在线 | 精品一区二区在线 | 日韩视频在线观看一区二区 | 欧美精品一区二区在线观看 | 国产不卡在线观看 | 国产福利91精品一区二区 | 欧美一区二区三区香蕉视 | 中文字幕国产欧美 | 欧美综合自拍亚洲综合百度 | 欧美91精品 | 亚洲精国产一区二区三区 | 亚洲精品在线第一页 | 毛片日韩 | 国产精品激情综合久久 | 91福利国产在线观一区二区 | 日本精品一区二区三区在线观看 | 国产69精品久久久久777 | 国产免费黄色 | 国产69久久精品成人看小说 | 一级毛片子| 日韩免费视频观看 | 欧美高清在线精品一区二区不卡 | 在线观看色网站 | 国内精品一区二区三区最新 | 最新国产在线 | 国产欧美综合精品一区二区 | 欧美精品午夜久久久伊人 | 大陆国产精品视频 | 波多野结衣在线免费观看 | 亚洲国产成人精彩精品 | 91大神在线精品视频一区 | 亚洲黄色一区二区 | 国模吧国模吧一二区 |