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

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

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

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

效果圖:

 

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)
 }

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

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論

高雄市| 扎赉特旗| 盈江县| 镇安县| 锡林浩特市| 金川县| 保德县| 合山市| 来宾市| 商河县| 方正县| 朝阳区| 花莲市| 秦皇岛市| 高碑店市| 澄江县| 阳春市| 德保县| 望江县| 沧州市| 玉田县| 达州市| 宁阳县| 峡江县| 清苑县| 安阳县| 平安县| 五河县| 那曲县| 吉林省| 佛山市| 兰溪市| 修文县| 泊头市| 定远县| 凤庆县| 栾城县| 舒城县| 普格县| 萨嘎县| 融水|