最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序自定義底部彈出框

 更新時間:2020年11月16日 10:07:44   作者:Mr_Sparta  
這篇文章主要為大家詳細介紹了微信小程序自定義底部彈出框,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了微信小程序底部彈出框展示的具體代碼,供大家參考,具體內(nèi)容如下

效果圖:

 

html

<view class="commodity_screen" bindtap="hideModal" wx:if="{{showModalStatus}}"></view>
<view animation="{{animationData}}" class="commodity_attr_box" wx:if="{{showModalStatus}}"></view>

CSS

.commodity_screen {
 width: 100%;
 height: 100%;
 position: fixed;
 top: 0;
 left: 0;
 background: #000;
 opacity: 0.2;
 overflow: hidden;
 z-index: 1000;
 color: #fff;
}

.commodity_attr_box {
 width: 100%;
 overflow: hidden;
 position: fixed;
 bottom: 0;
 left: 0;
 z-index: 2000;
 background: #fff;
 padding-top: 20rpx;
}

 JS動畫樣式

 showModal: function () {
 // 顯示遮罩層
 var animation = wx.createAnimation({
 duration: 200,
 timingFunction: "linear",
 delay: 0
 })
 this.animation = animation
 animation.translateY(300).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(300).step()
 this.setData({
 animationData: animation.export(),
 })
 setTimeout(function () {
 animation.translateY(0).step()
 this.setData({
 animationData: animation.export(),
 showModalStatus: false
 })
 }.bind(this), 200)
 }

為大家推薦現(xiàn)在關(guān)注度比較高的微信小程序教程一篇:《微信小程序開發(fā)教程》小編為大家精心整理的,希望喜歡。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

荆门市| 鲁山县| 扎囊县| 昆山市| 洛川县| 将乐县| 镇巴县| 兖州市| 游戏| 辰溪县| 龙江县| 东乡县| 尼木县| 卢氏县| 赤水市| 缙云县| 常宁市| 保亭| 灵丘县| 宁波市| 武汉市| 扎囊县| 黎平县| 沧源| 京山县| 金华市| 广德县| 宜黄县| 苏尼特右旗| 嘉义县| 连南| 麻栗坡县| 康马县| 云霄县| 准格尔旗| 屏东市| 华容县| 灌云县| 旬阳县| 丰都县| 呼伦贝尔市|