微信小程序動(dòng)畫之彈出菜單,供大家參考,具體內(nèi)容如下
“真誠(chéng)服務(wù),讓網(wǎng)絡(luò)創(chuàng)造價(jià)值”是我們的服務(wù)理念,成都創(chuàng)新互聯(lián)團(tuán)隊(duì)十多年如一日始終堅(jiān)持在網(wǎng)站建設(shè)領(lǐng)域,為客戶提供優(yōu)質(zhì)服。不管你處于什么行業(yè),助你輕松跨入“互聯(lián)網(wǎng)+”時(shí)代,PC網(wǎng)站+手機(jī)網(wǎng)站+公眾號(hào)+小程序定制開(kāi)發(fā)。效果圖
js:
Page({ data: { isPopping: false, animPlus: {}, animCollect: {}, animTranspond: {}, animInput: {}, animCloud:{}, aninWrite:{}, }, //點(diǎn)擊彈出 plus: function () { if (this.data.isPopping) { //縮回動(dòng)畫 this.popp(); this.setData({ isPopping: false }) } else if (!this.data.isPopping) { //彈出動(dòng)畫 this.takeback(); this.setData({ isPopping: true }) } }, input: function () { console.log("input") }, transpond: function () { console.log("transpond") }, collect: function () { console.log("collect") }, cloud:function(){ console.log("cloud") }, write: function () { console.log("cloud") }, //彈出動(dòng)畫 popp: function () { //plus順時(shí)針旋轉(zhuǎn) var animationPlus = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationcollect = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationTranspond = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationInput = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationCloud = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationWrite = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) animationPlus.rotateZ(180).step(); animationcollect.translate(-90, -100).rotateZ(180).opacity(1).step(); animationTranspond.translate(-140, 0).rotateZ(180).opacity(1).step(); animationInput.translate(-90, 100).rotateZ(180).opacity(1).step(); animationCloud.translate(0, 135).rotateZ(180).opacity(1).step(); animationWrite.translate(0, -135).rotateZ(180).opacity(1).step(); this.setData({ animPlus: animationPlus.export(), animCollect: animationcollect.export(), animTranspond: animationTranspond.export(), animInput: animationInput.export(), animCloud: animationCloud.export(), animWrite: animationWrite.export(), }) }, //收回動(dòng)畫 takeback: function () { //plus逆時(shí)針旋轉(zhuǎn) var animationPlus = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationcollect = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationTranspond = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationInput = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationCloud = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) var animationWrite = wx.createAnimation({ duration: 400, timingFunction: 'ease-out' }) animationPlus.rotateZ(0).step(); animationcollect.translate(0, 0).rotateZ(0).opacity(0).step(); animationTranspond.translate(0, 0).rotateZ(0).opacity(0).step(); animationInput.translate(0, 0).rotateZ(0).opacity(0).step(); animationCloud.translate(0, 0).rotateZ(0).opacity(0).step(); animationWrite.translate(0, 0).rotateZ(0).opacity(0).step(); this.setData({ animPlus: animationPlus.export(), animCollect: animationcollect.export(), animTranspond: animationTranspond.export(), animInput: animationInput.export(), animCloud: animationCloud.export(), animWrite: animationWrite.export(), }) }, onLoad: function (options) { // 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面加載 }, onReady: function () { // 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面初次渲染完成 }, onShow: function () { // 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面顯示 }, onHide: function () { // 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面隱藏 }, onUnload: function () { // 生命周期函數(shù)--監(jiān)聽(tīng)頁(yè)面卸載 }, onPullDownRefresh: function () { // 頁(yè)面相關(guān)事件處理函數(shù)--監(jiān)聽(tīng)用戶下拉動(dòng)作 }, onReachBottom: function () { // 頁(yè)面上拉觸底事件的處理函數(shù) }, onShareAppMessage: function () { // 用戶點(diǎn)擊右上角分享 return { title: 'title', // 分享標(biāo)題 desc: 'desc', // 分享描述 path: 'path' // 分享路徑 } } })
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
文章題目:微信小程序?qū)崿F(xiàn)彈出菜單動(dòng)畫-創(chuàng)新互聯(lián)
分享URL:http://www.rwnh.cn/article22/epjjc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開(kāi)發(fā)、網(wǎng)站排名、面包屑導(dǎo)航、用戶體驗(yàn)、品牌網(wǎng)站設(shè)計(jì)、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容