国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

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

2019-11-19 13:31:27
字體:
供稿:網(wǎng)友

本文實(shí)例為大家分享了微信小程序底部彈出框展示的具體代碼,供大家參考,具體內(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) }

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

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 新密市| 桐乡市| 临清市| 临武县| 盐边县| 岱山县| 胶州市| 晋中市| 小金县| 米泉市| 昆明市| 巴青县| 资中县| 宁安市| 湘潭县| 上犹县| 龙南县| 麟游县| 韶山市| 铜川市| 孙吴县| 宁德市| 滁州市| 台东县| 潜江市| 合作市| 沛县| 教育| 尚志市| 姚安县| 和林格尔县| 海伦市| 江华| 改则县| 临沂市| 巨鹿县| 大悟县| 阿克苏市| 广德县| 喜德县| 河北区|