微信小程式js過度動畫

2021-10-05 02:14:56 字數 3259 閱讀 3088

一,我們先來看看效果吧。

二,我們用的是js的逐幀動畫,css也可有相同的效果,我們這裡用js

// pages/arrary/first/more4/more4.js

let puts =

['cloud:'

,'cloud:'

,'cloud:'

,'cloud:'

,'cloud:'

,'cloud:'

,'cloud:'

,'cloud:'

,'cloud:'

]page(,

tip())

},ones()

);settimeout

(function()

) that.

twoed()

},4000)}

,min()

)break;}

case1:

)break;}

case2:

)break;}

case3:

)break;}

case4:

)break;}

case5:

)break;}

case6:

)break;}

case7:

)break;}

case8:

)break;}

} j++;if

(j ==12)

},800)},

twoed()

);if(text.length == tows.length)

, 2000)

var p =

'block'

that.data.foot.

splice(0

,1, p)

;var than = that.data.foot

that.

setdata()

}},100)}

,foots1

(e))

console.

log(than)},

foots2

(e))

console.

log(than)},

foots3

(e))

console.

log(than)},

foots4

(e))

console.

log(than)},

foots5

(e))

console.

log(than)},

foots6

(e))

console.

log(than)},

foots7

(e))

console.

log(than)},

foots8

(e))

console.

log(than)},

foots9

(e))

console.

log(than)},

foots10

(e))

console.

log(than)},

/** * 生命週期函式--監聽頁面載入

*/onload:

function

(options)

})

三,wxml部分用的是九宮格布局。

="eye"

>

="wood"

>

="line"

>

="line1_1 lines" bindtap=

"tip"

>

="puture" src=

"}">

<

/image>

<

/view>

="line1_1 lines"

>

="puture" src=

"}">

<

/image>

<

/view>

="line1_1 lines" bindtap=

"tip"

>

="puture" src=

"}">

<

/image>

<

/view>

<

/view>

="line"

>

="line1_1 lines"

>

="puture" src=

"}">

<

/image>

<

/view>

="line1_1 lines" bindtap=

"ones"

>

="puture" src=

"}">

<

/image>

<

/view>

="line1_1 lines"

>

="puture" src=

"}">

<

/image>

<

/view>

<

/view>

="line"

>

="line1_1 lines" bindtap=

"tip"

>

="puture" src=

"}">

<

/image>

<

/view>

="line1_1 lines"

>

="puture" src=

"}">

<

/image>

<

/view>

="line1_1 lines" bindtap=

"tip"

>

="puture" src=

"}">

<

/image>

<

/view>

<

/view>

<

/view>

<

/view>

四.最後用的wxss的布局。

微信小程式動畫

一 自定義動畫使用步驟 1.建立動畫例項 let animation wx.createanimation duration 900 2.呼叫例項的方法 動畫執行過程 animation.opacity 0.5 scale 1.3,1.3 step opacity 1 scale 1,1 step ...

微信小程式 動畫animation

二 動畫 注意獲取元素節點方法為非同步呼叫,因此使用promise,確保節點獲取到值後再返回獲取的width寬度。引數 select 想要獲取的節點的類名,使用 getrect classname getrect select exec 工具函式寫完後,呼叫獲取元素屬性,注意生命週期函式使用read...

微信小程式底部彈窗動畫

第一步,在元件裡編寫彈窗的 view class bottommodel wx if catchtouchmove tocatch view view class fixedmodel wx if animation view class wraps view class fixedtitle vi...