小編給大家分享一下小程序popupwindow彈出框怎么實(shí)現(xiàn),希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
目前創(chuàng)新互聯(lián)建站已為上千余家的企業(yè)提供了網(wǎng)站建設(shè)、域名、雅安服務(wù)器托管、網(wǎng)站托管維護(hù)、企業(yè)網(wǎng)站設(shè)計(jì)、管城網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。
小程序popupwindow彈出框的實(shí)現(xiàn)代碼
wxml
Dialog內(nèi)容
wcss
.zan-dialog__mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(0, 0, 0, 0.4); display: none; } .zan-dialog__container { position: fixed; top: 0; width: 750rpx; background: white; transform: translateY(-150%); transition: all 0.4s ease; z-index: 12; } .zan-dialog--show .zan-dialog__container { transform: translateY(0); } .zan-dialog--show .zan-dialog__mask { display: block; }
js
Page({ data: { showDialog: false },//控制 pop 的打開關(guān)閉 toggleDialog() { this.setData({ showDialog: !this.data.showDialog }); }, })
wxml
Dialog內(nèi)容
wcss
.zan-dialog__mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10; background: rgba(0, 0, 0, 0.4); display: none; } .zan-dialog__container { position: fixed; bottom: 0; width: 750rpx; background: white; transform: translateY(150%); transition: all 0.4s ease; z-index: 12; } .zan-dialog--show .zan-dialog__container { transform: translateY(0); } .zan-dialog--show .zan-dialog__mask { display: block; }
js
Page({ data: { showDialog: false },//控制 pop 的打開關(guān)閉 toggleDialog() { this.setData({ showDialog: !this.data.showDialog }); }, })
看完了這篇文章,相信你對“小程序popupwindow彈出框怎么實(shí)現(xiàn)”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!