在整个页面加载后启动 css3 动画 [英] start css3 animation after entire page load

查看:65
本文介绍了在整个页面加载后启动 css3 动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何在页面的其余部分(图像和所有内容)完全加载后启动 css3 动画?

Anyone know how to start a css3 animation after the rest of the page loads completely (images and everything)?

我现在正在使用延迟来模仿它,但这不是我想要的.

I am using a delay right now to mimic it but this is not what I'm looking for.

谢谢

彼得

推荐答案

这超出了 CSS 的范围,但是用 JQuery 来做还是很简单的

That is beyond the scope of CSS, but it is quite simple to do with JQuery

$(document).ready(function() {/*You code here*/ }

或在此处阅读更多相关信息 => http://api.jquery.com/ready/

Or read more about it here => http://api.jquery.com/ready/

将你的动画代码放在一个类中,比如.animation

Place your animation code in a class, lets say .animation

然后使用 JQuery .addclass() (http://api.jquery.com/addClass/)

Then call that class on the element you wish to animate using JQuery .addclass() (http://api.jquery.com/addClass/)

类似的东西

   <script type="text/javascript">
    $(document).ready(function() {
    $("#element-to-animate").addClass("animation"); 
    });
   </script>

这篇关于在整个页面加载后启动 css3 动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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