<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:21
        文檔

        微信小程序自定義對話框彈出和隱藏動畫

        本文實例為大家分享了微信小程序自定義對話框彈出和隱藏動畫的具體代碼,供大家參考,具體內容如下:index.js;,//index.jsvar app = getApp();let animationShowHeight = 300;Page({ data:{ animationData:"".showModalStatus:false.imageHeight:0.imageWidth:0 }.imageLoad: function (e) {this.setData({imageHeight:e.detail.height。index.wxml。
        推薦度:
        導讀本文實例為大家分享了微信小程序自定義對話框彈出和隱藏動畫的具體代碼,供大家參考,具體內容如下:index.js;,//index.jsvar app = getApp();let animationShowHeight = 300;Page({ data:{ animationData:"".showModalStatus:false.imageHeight:0.imageWidth:0 }.imageLoad: function (e) {this.setData({imageHeight:e.detail.height。index.wxml。

        本文實例為大家分享了微信小程序自定義對話框彈出和隱藏動畫的具體代碼,供大家參考,具體內容如下

        index.js

        //index.js
        var app = getApp();
         
        let animationShowHeight = 300;
         
        Page({
         data:{
         animationData:"",
         showModalStatus:false,
         imageHeight:0,
         imageWidth:0
         },
         imageLoad: function (e) { 
         this.setData({imageHeight:e.detail.height,imageWidth:e.detail.width}); 
         },
         showModal: function () {
         // 顯示遮罩層
         var animation = wx.createAnimation({
         duration: 200,
         timingFunction: "linear",
         delay: 0
         })
         this.animation = animation
         animation.translateY(animationShowHeight).step()
         this.setData({
         animationData: animation.export(),
         showModalStatus: true
         })
         setTimeout(function () {
         animation.translateY(0).step()
         this.setData({
         animationData: animation.export()
         })
         }.bind(this), 200)
         },
         hideModal: function () {
         // 隱藏遮罩層
         var animation = wx.createAnimation({
         duration: 200,
         timingFunction: "linear",
         delay: 0
         })
         this.animation = animation;
         animation.translateY(animationShowHeight).step()
         this.setData({
         animationData: animation.export(),
         })
         setTimeout(function () {
         animation.translateY(0).step()
         this.setData({
         animationData: animation.export(),
         showModalStatus: false
         })
         }.bind(this), 200)
         },
         onShow:function(){
         let that = this;
         wx.getSystemInfo({
         success: function(res) {
         animationShowHeight = res.windowHeight;
         }
         })
         },
         
        })
        
        

        index.wxml

        <!--index.wxml-->
        <view class="container-column">
         
         <view animation="{{animationData}}" class="container-column buydes-dialog-container" wx:if="{{showModalStatus}}">
         <view class="buydes-dialog-container-top" bindtap="hideModal"></view>
         <view class="container-column buydes-dialog-container-bottom">
         <block wx:for="{{['操作1','操作2','操作3','取消']}}" wx:for-index="index" wx:key="key" wx:for-item="item">
         <view bindtap="hideModal" class="buydes-dialog-container-bottom-item" >{{item}}</view>
         </block>
         </view>
         </view>
         
         <image bindtap="showModal" bindload="imageLoad" style="width:{{imageWidth}}px;;height:{{imageHeight}}px;" src="../pro1.jpg"/>
         
        </view>

        index.wxss

        .buydes-dialog-container{
         width: 100%;
         height: 100%;
         justify-content: space-between;
         background-color:rgba(15, 15, 26, 0.7);
         position: fixed;
         z-index: 999;
        }
         
        .buydes-dialog-container-top{
         flex-grow: 1;
        }
         
        .buydes-dialog-container-bottom{
         display: flex;
         flex-grow: 0;
        }
         
        .buydes-dialog-container-bottom-item{
         padding:24rpx;
         display: flex;
         justify-content: center;
         border-bottom: 1rpx solid #eeeeee;
        }
        

        效果圖:


        下面是實際開發中的效果圖,沒有源碼,但是原理和上面的是一樣的,通過上面的DEMO學習加上平常的CSS基礎,完全可以做出下面的效果

        源碼下載:微信小程序自定義對話框彈出和隱藏動畫

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

        文檔

        微信小程序自定義對話框彈出和隱藏動畫

        本文實例為大家分享了微信小程序自定義對話框彈出和隱藏動畫的具體代碼,供大家參考,具體內容如下:index.js;,//index.jsvar app = getApp();let animationShowHeight = 300;Page({ data:{ animationData:"".showModalStatus:false.imageHeight:0.imageWidth:0 }.imageLoad: function (e) {this.setData({imageHeight:e.detail.height。index.wxml。
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲国产精品专区| 99久久精品国产亚洲| ass亚洲**毛茸茸pics| 全免费a级毛片免费看| 国产美女亚洲精品久久久综合| 四虎一区二区成人免费影院网址 | 亚洲自偷自拍另类12p| 三上悠亚在线观看免费| 怡红院亚洲怡红院首页| h视频在线免费观看| 中文字幕一精品亚洲无线一区| xxxxx做受大片在线观看免费| 亚洲国产精品第一区二区三区| 欧洲美女大片免费播放器视频| 亚洲国产中文v高清在线观看| 免费无码一区二区| 亚洲国产综合精品一区在线播放| 香港特级三A毛片免费观看| 四虎永久在线精品免费影视| 男女作爱免费网站| 久久亚洲国产成人影院网站| 中文字幕免费人成乱码中国| 亚洲国产日韩一区高清在线 | 99久久99久久精品免费看蜜桃| 亚洲国产成人九九综合| 国产免费av片在线看| 久久人午夜亚洲精品无码区| 亚洲日本一区二区三区在线不卡| a级成人毛片免费视频高清| 久久亚洲一区二区| 中文字幕在线观看免费视频| 亚洲欧洲日韩国产一区二区三区| 国产精品免费_区二区三区观看| 午夜成人无码福利免费视频| 国产亚洲一区二区三区在线| 免费黄色福利视频| 亚洲国产精品ⅴa在线观看| 亚洲精品国产综合久久一线| 亚洲免费人成在线视频观看| 亚洲综合色区中文字幕| 波多野结衣视频在线免费观看 |