如何当动画结束创建活动? [英] How to create an event when the animation ends?

查看:183
本文介绍了如何当动画结束创建活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1 - 如何当动画结束创建活动?
动画写在CSS3

1 - How to create an event when the animation ends? Animation written in css3

2 - 如何玩,只有当在浏览器中加载的所有数据的动画?
你可以看到

2 - How to Play the animation only when all data loaded in the browser ? You can see

许多THX。
演示的jsfiddle

推荐答案

1 - 你需要添加一个animationEnd事件侦听器

1 -You need to add an animationEnd event listener

document.getElementById('animation-03').addEventListener('animationend', function () {
    alert('end')
}, false);

请确保您添加它为所有的浏览器厂商。

Make sure you add it for all browser vendors.

下面是一个分支的版本: http://jsfiddle.net/Fj2vF/2/

Here is a forked version: http://jsfiddle.net/Fj2vF/2/

2 - 不要担心。由于W3C斑点所说的一切都被加载,只有当你的动画将启动。

2 - Do not worry about this. As the W3C specks say your animation will start only when everything is loaded.

这篇关于如何当动画结束创建活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆