鍍金池/ 問(wèn)答/HTML/ 微信小程序如何實(shí)現(xiàn)每次點(diǎn)擊都實(shí)現(xiàn)一次動(dòng)畫

微信小程序如何實(shí)現(xiàn)每次點(diǎn)擊都實(shí)現(xiàn)一次動(dòng)畫

我想實(shí)現(xiàn)點(diǎn)擊一次就實(shí)現(xiàn)一次翻轉(zhuǎn)的效果,翻轉(zhuǎn)代碼如下:

clipboard.png

這時(shí)animationData的值如下:

clipboard.png

我嘗試每次清空它的值后再重新創(chuàng)建animation動(dòng)畫,我覺得這樣就能實(shí)現(xiàn)效果:

clipboard.png

不過(guò)我想多了....

請(qǐng)問(wèn)該如何使用微信小程序animation實(shí)現(xiàn)這個(gè)效果?有沒(méi)有其他的方法?比如不用animation?

回答
編輯回答
疚幼

我的建議是,不要用wx.createAnimation,坑巨多……
建議使用CSS3 animation

2018年4月7日 13:23