• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題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關(guān)鍵字專題關(guān)鍵字專題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
    當(dāng)前位置: 首頁 - 科技 - 知識(shí)百科 - 正文

    微信小程序?qū)崿F(xiàn)彈出菜單

    來源:懂視網(wǎng) 責(zé)編:小OO 時(shí)間:2020-11-27 22:11:16
    文檔

    微信小程序?qū)崿F(xiàn)彈出菜單

    本文實(shí)例為大家分享了微信小程序?qū)崿F(xiàn)彈出菜單的具體代碼,供大家參考,具體內(nèi)容如下:菜單;代碼。1.index.js。,//index.js//獲取應(yīng)用實(shí)例var app = getApp()Page({ data: { isPopping: false,//是否已經(jīng)彈出 animationPlus: {},//旋轉(zhuǎn)動(dòng)畫 animationcollect: {},//item位移,透明度 animationTranspond: {},//item位移,透明度 animationInput: {},//item位移。2.index.wxml。
    推薦度:
    導(dǎo)讀本文實(shí)例為大家分享了微信小程序?qū)崿F(xiàn)彈出菜單的具體代碼,供大家參考,具體內(nèi)容如下:菜單;代碼。1.index.js。,//index.js//獲取應(yīng)用實(shí)例var app = getApp()Page({ data: { isPopping: false,//是否已經(jīng)彈出 animationPlus: {},//旋轉(zhuǎn)動(dòng)畫 animationcollect: {},//item位移,透明度 animationTranspond: {},//item位移,透明度 animationInput: {},//item位移。2.index.wxml。

    本文實(shí)例為大家分享了微信小程序?qū)崿F(xiàn)彈出菜單的具體代碼,供大家參考,具體內(nèi)容如下

    菜單

    代碼:

    1.index.js

    //index.js
    //獲取應(yīng)用實(shí)例
    var app = getApp()
    Page({
     data: {
     isPopping: false,//是否已經(jīng)彈出
     animationPlus: {},//旋轉(zhuǎn)動(dòng)畫
     animationcollect: {},//item位移,透明度
     animationTranspond: {},//item位移,透明度
     animationInput: {},//item位移,透明度
     //我的博客:http://blog.csdn.net/qq_31383345
     //CSDN微信小程序開發(fā)專欄:http://blog.csdn.net/column/details/13721.html
     },
     onLoad: function () {
    
     },
     //點(diǎn)擊彈出
     plus: function () {
     if (this.data.isPopping) {
     //縮回動(dòng)畫
     popp.call(this);
     this.setData({
     isPopping: false
     })
     } else {
     //彈出動(dòng)畫
     takeback.call(this);
     this.setData({
     isPopping: true
     })
     }
     },
     input: function () {
     console.log("input")
     },
     transpond: function () {
     console.log("transpond")
     },
     collect: function () {
     console.log("collect")
     }
    })
    
    
    
    //彈出動(dòng)畫
    function popp() {
     //plus順時(shí)針旋轉(zhuǎn)
     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(),
     })
    }
    //收回動(dòng)畫
    function takeback() {
     //plus逆時(shí)針旋轉(zhuǎn)
     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代碼下載

    聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    微信小程序?qū)崿F(xiàn)彈出菜單

    本文實(shí)例為大家分享了微信小程序?qū)崿F(xiàn)彈出菜單的具體代碼,供大家參考,具體內(nèi)容如下:菜單;代碼。1.index.js。,//index.js//獲取應(yīng)用實(shí)例var app = getApp()Page({ data: { isPopping: false,//是否已經(jīng)彈出 animationPlus: {},//旋轉(zhuǎn)動(dòng)畫 animationcollect: {},//item位移,透明度 animationTranspond: {},//item位移,透明度 animationInput: {},//item位移。2.index.wxml。
    推薦度:
    標(biāo)簽: 微信小程序 菜單 彈出
    • 熱門焦點(diǎn)

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 国产香蕉国产精品偷在线观看| 无码精品视频一区二区三区| 四虎国产精品免费久久| 凹凸国产熟女精品视频app| 亚洲国产主播精品极品网红 | 99精品人妻少妇一区二区| 精品无码无人网站免费视频| 欧美亚洲另类精品第一页 | 久久亚洲私人国产精品vA| 无码精品人妻一区| 精品伦精品一区二区三区视频| 久久91精品国产91久久麻豆| 少妇精品无码一区二区三区| 全国精品一区二区在线观看| 国产精品女人呻吟在线观看| 亚洲精品欧美综合| 国产精品你懂得| 国产精品久久久久久久久鸭| 国产精品一区二区av| 欧美精品欧美人与动人物牲交 | 精品欧美一区二区在线观看 | 一本精品中文字幕在线| 麻豆精品国产自产在线观看一区| 亚洲综合精品一二三区在线| 国产伦精品一区二区三区女| 国精无码欧精品亚洲一区| 久久夜色精品国产噜噜噜亚洲AV| 亚洲AV成人精品网站在线播放| 亚洲欧美日韩国产成人精品影院| 亚洲AV成人精品日韩一区18p| 欧洲精品码一区二区三区免费看| 精品国产亚洲男女在线线电影| 国产精品久久久99| 国产乱人伦精品一区二区在线观看| 成人精品一区二区三区在线观看| 国产精品99久久精品爆乳| 国语自产拍精品香蕉在线播放| 久久99精品久久久久久动态图| 亚洲日韩精品无码一区二区三区| 亚洲精品网站在线观看不卡无广告 | 久久久精品人妻一区二区三区四|