我已经建立了一个小的网络应用与聚合物,我使用霓虹灯动画。我想在特定动画的自动化测试中测量fps (例如英雄动画和纹波动画)。霓虹灯动画中是否有animationEnd事件,或者如何确定动画的结尾?
发布于 2015-08-17 12:23:15
在neon-animation-runner-behavior中,当动画完成时,会触发事件neon-animation-finish。您可以在元素中为此添加一个侦听器,当事件被触发时,该监听器将调用一个函数。例如:
<script>
Polymer({
is: "my-animated-element",
behaviors: [
Polymer.NeonAnimationRunnerBehavior
],
properties: {
animationConfig: {
value: function () {
// config here
}
}
},
listeners: {
'neon-animation-finish': '_onNeonAnimationFinish'
},
_onNeonAnimationFinish: function () {
alert("animation finished!");
}
});
</script>关于如何使用neon-animation元素的更多信息,可以在这可怕的视频中找到。
https://stackoverflow.com/questions/32044678
复制相似问题