<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
        主站蜘蛛池模板: 国产精品免费αv视频| 精品无码AV无码免费专区 | 67pao强力打造高清免费| 亚洲欧洲美洲无码精品VA | 18未年禁止免费观看| 亚洲国产精品嫩草影院在线观看 | 国产成人免费永久播放视频平台 | 国产成人精品久久亚洲高清不卡 | 亚洲免费视频一区二区三区| 日本永久免费a∨在线视频| 免费大黄网站在线观| 亚洲成在人线中文字幕| 日韩免费a级毛片无码a∨| 亚洲色少妇熟女11p| 秋霞人成在线观看免费视频| 免费永久在线观看黄网站| 老妇激情毛片免费| 国产在线a免费观看| 亚洲一区二区三区国产精华液| 国产黄色片在线免费观看| 色多多A级毛片免费看| 亚洲国产精品乱码一区二区 | 一级全免费视频播放| 在线日韩av永久免费观看| 一级看片免费视频| 亚洲高清在线观看| 国产高潮久久免费观看| 亚洲久本草在线中文字幕| jizz在线免费播放| 亚洲免费在线视频| 韩国欧洲一级毛片免费| 中文字幕视频免费在线观看| 免费A级毛片在线播放不收费| 国产黄片不卡免费| 亚洲人成网网址在线看| 亚洲?V乱码久久精品蜜桃| 中文字幕免费在线| 青青青亚洲精品国产| 亚洲va无码va在线va天堂| 两性色午夜视频免费播放| 亚洲午夜电影在线观看高清|