欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序?qū)崿F(xiàn)彈出菜單動(dòng)畫

 更新時(shí)間:2019年06月21日 11:35:04   作者:CodeHunter_qcy  
這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)彈出菜單動(dòng)畫,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

微信小程序動(dòng)畫之彈出菜單,供大家參考,具體內(nèi)容如下

效果圖

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' // 分享路徑
  }
 }
})

wxml:

<view>
 <image src="../../image/1.png" class="img-style" animation="{{animWrite}}" bindtap="write"></image>
 <image src="../../image/4.png" class="img-style" animation="{{animCollect}}" bindtap="collect"></image>
 <image src="../../image/2.png" class="img-style" animation="{{animTranspond}}" bindtap="transpond"></image>
 <image src="../../image/3.png" class="img-style" animation="{{animInput}}" bindtap="input"></image>
 <image src="../../image/5.png" class="img-style" animation="{{animCloud}}" bindtap="cloud"></image>
 <image src="../../image/6.png" class="img-switch-style" animation="{{animPlus}}" bindtap="plus"></image>
</view>

wxss:

.img-switch-style {
 height: 120rpx;
 width: 120rpx;
 position: absolute;
 bottom: 250rpx;
 right: 100rpx;
 z-index: 100;
}
 
.img-style {
 height: 120rpx;
 width: 120rpx;
 position: absolute;
 bottom: 250rpx;
 right: 100rpx;
 opacity: 0;
}

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

相關(guān)文章

  • 基于邏輯運(yùn)算的簡(jiǎn)單權(quán)限系統(tǒng)(實(shí)現(xiàn)) JS 版

    基于邏輯運(yùn)算的簡(jiǎn)單權(quán)限系統(tǒng)(實(shí)現(xiàn)) JS 版

    基于邏輯運(yùn)算的簡(jiǎn)單權(quán)限系統(tǒng)(實(shí)現(xiàn)) JS 版...
    2007-03-03
  • 判斷是否存在子節(jié)點(diǎn)的實(shí)現(xiàn)代碼

    判斷是否存在子節(jié)點(diǎn)的實(shí)現(xiàn)代碼

    下面小編就為大家?guī)?lái)一篇判斷是否存在子節(jié)點(diǎn)的實(shí)現(xiàn)代碼。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2016-05-05
  • JS調(diào)試必備的5個(gè)debug技巧

    JS調(diào)試必備的5個(gè)debug技巧

    我一直使用printf調(diào)試程序,一般來(lái)說(shuō)都是比較順利,但有時(shí)候,你會(huì)發(fā)現(xiàn)需要更好的方法。下面幾個(gè)JavaScript技巧相信你一定會(huì)覺(jué)得十分有用
    2014-03-03
  • JavaScript框架(iframe)操作總結(jié)

    JavaScript框架(iframe)操作總結(jié)

    這篇文章主要介紹了JavaScript框架(iframe)操作,介紹了種情況下的操作方法,需要的朋友可以參考下
    2014-04-04
  • 原生JS實(shí)現(xiàn)數(shù)碼表特效

    原生JS實(shí)現(xiàn)數(shù)碼表特效

    這篇文章主要為大家詳細(xì)介紹了原生JS實(shí)現(xiàn)數(shù)碼表特效,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-10-10
  • 一文帶你簡(jiǎn)單封裝JS下的異步任務(wù)對(duì)象

    一文帶你簡(jiǎn)單封裝JS下的異步任務(wù)對(duì)象

    我們?cè)跓倪^(guò)程中去干了別的事情,就屬于異步模式,異步模式中不會(huì)等待異步任務(wù)的結(jié)束才開(kāi)始執(zhí)行下一個(gè)同步的任務(wù),都是開(kāi)啟過(guò)后就立即執(zhí)行下一個(gè)任務(wù),下面這篇文章主要給大家介紹了如何通過(guò)一文帶你簡(jiǎn)單封裝JS下的異步任務(wù)對(duì)象的相關(guān)資料,需要的朋友可以參考下
    2022-11-11
  • 微信小程序?qū)崿F(xiàn)底部彈窗

    微信小程序?qū)崿F(xiàn)底部彈窗

    這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)底部彈窗,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-07-07
  • JavaScript面向?qū)ο缶?上部)

    JavaScript面向?qū)ο缶?上部)

    這篇文章主要介紹了JavaScript面向?qū)ο缶?需要的朋友可以參考下
    2017-09-09
  • 基于ES6 Array.of的用法(實(shí)例講解)

    基于ES6 Array.of的用法(實(shí)例講解)

    下面小編就為大家?guī)?lái)一篇基于ES6 Array.of的用法(實(shí)例講解)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-09-09
  • 微信小程序云開(kāi)發(fā)之使用云函數(shù)

    微信小程序云開(kāi)發(fā)之使用云函數(shù)

    這篇文章主要為大家詳細(xì)介紹了微信小程序云開(kāi)發(fā)之使用云函數(shù),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2019-05-05

最新評(píng)論