<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答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
        主站蜘蛛池模板: 亚洲一二成人精品区| 亚洲成a人片在线观看久| 亚洲高清专区日韩精品| 国产福利免费视频 | 免费国产在线精品一区| 在线不卡免费视频| 久久水蜜桃亚洲AV无码精品| 国产禁女女网站免费看| 色婷婷亚洲一区二区三区| 免费永久国产在线视频| 污污视频免费观看网站| 亚洲熟女乱综合一区二区| 一级黄色免费毛片| 亚洲成AV人片在| 亚洲欧洲免费视频| 亚洲免费视频网址| 日本免费人成黄页在线观看视频| 爱情岛论坛亚洲品质自拍视频网站| 免费看国产一级片| 黄页免费在线观看| 亚洲男人天堂影院| 日美韩电影免费看| 你懂的在线免费观看| 在线免费观看亚洲| 破了亲妺妺的处免费视频国产| 国产精品久久亚洲一区二区| 亚洲热妇无码AV在线播放| 19禁啪啪无遮挡免费网站| 亚洲乱亚洲乱妇无码| 亚洲第一视频在线观看免费| 免费观看久久精彩视频| 亚洲色精品VR一区区三区| 久久亚洲色一区二区三区| 99re6热视频精品免费观看| 亚洲国产精品精华液| 亚洲精品乱码久久久久久久久久久久| 久久永久免费人妻精品下载| 亚洲国产成人无码AV在线| 国产V亚洲V天堂A无码| 久久久久国色AV免费看图片 | 亚洲性无码AV中文字幕|