小程序 animationed 事件触发不了了?还是用法不对?求官方答疑
发布于 5 年前 作者 kpeng 5678 次浏览 来自 问答

小程序的标红的这些事件没有触发是怎么回事呢?

比如 animationed 事件绑定在wxml上,当wxml的wxss 动画完成时 并没有触发这个事件。不知道是我是我使用方式不对,还是怎么的。如果官方可以用的话,可以贴个实例代码吗?

这是我的示例代码 :

<view class='single-item current-page' style='z-index:1;animation:turnRightSingle ease 1000ms 1000ms both'  animationend='finish'></view>
[@keyframes](/user/keyframes) turnRightSingle{
  from{
    transform: rotateY(-180deg)
  }
  to{
    transform: rotateY(0deg)
  }
}
finish:function(e){
    console.log(e+"哈哈哈哈")
  },
3 回复

想问下楼主,bindanimationend 是可用的吗?

bindanimationend

哦,是的。忘了bind了。哈哈哈

回到顶部