2013-10-26 118 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(函數(){}對於整個頁面加載後,該動畫類添加到您的元素

所以動畫將頁面加載