2013-10-26 123 views
0

如何在页面上的所有内容被加载时将页面加载? 例如:http://www.creabox.es/themes/verde/index_images.php当页面加载时Css 3动画

我的代码:

#h1count {opacity: 0; 
    transition: opacity .25s ease-in-out; 
    -moz-transition: opacity .25s ease-in-out; 
    -webkit-transition: opacity .25s ease-in-out; 
} 



#h1count { 
     font-family: 'League Gothic'; 
    src: url('leaguegothic-regular-webfont.eot'); 
    src: url('leaguegothic-regular-webfont.eot?#iefix') format('embedded-opentype'), 
     url('leaguegothic-regular-webfont.woff') format('woff'), 
     url('leaguegothic-regular-webfont.ttf') format('truetype'), 
     url('leaguegothic-regular-webfont.svg#league_gothicregular') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
    font-size:70px; 
    line-height:70px; 
    opacity: 1; 
+1

不要之后运行。没有JavaScript的网站是空白的,任何类型的启动画面都是坏的UX。 – Ryan

回答

0

的esiest解决方案是将在类动画并在CSS编写

例如

.animation { 
    animation: anim-1 0.2s ... 
    -webkit-animation: anim-1 ... 
} 

和控制通过库或插件通过Javascript加载html元素... 有很多它们在那里

,或者你可以使用jQuery方法$(元素).load(函数(){}

,并确保everythi8ng加载

可以使用$(窗口).load(函数(){}对于整个页面加载后,该动画类添加到您的元素

所以动画将页面加载