廢話(huà)不多說(shuō)了,直接給大家貼代碼了,具體代碼如下所示:
<div class="loading"> <p>100<span></span></p> </div>
*{margin:0;padding:0;} .loading{ height:100%;width:100%;position:fixed;background:rgba(255,255,255,1); } .loading >p{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;height:160px;width:160px;text-align: center;line-height:160px;font-size: 30px;color:#f00;} .loading p span{position:absolute;display:block;height:140px;width:140px;margin:10px;border-radius:50%;-webkit-box-shadow:0 2px 3px rgba(102,197,37,0.8); animation:loading ease 1s infinite;left:0;top:0;} @keyframes loading{ 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }
<div class="loading"> <p> <i></i> <i></i> <i></i> <i></i> <i></i> </p> </div>
*{margin:0;padding:0;} .loading{ height:100%;width:100%;position:fixed;background:rgba(255,255,255,0.95); } .loading >p{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;height:30px;width:120px;} .loading >p i{display: block;float:left;margin:0 5px; width:5px;height:30px;background:#f00;transform:scaleY(0.3); animation:loading 1s ease infinite alternate; } .loading >p i:nth-child(2){animation-delay:0.1s;} .loading >p i:nth-child(3){animation-delay:0.2s;} .loading >p i:nth-child(4){animation-delay:0.3s;} .loading >p i:nth-child(5){animation-delay:0.4s;} @keyframes loading{ 0,40%,100%{transform:scaleY(0.3);} 20%{transform:scaleY(1);} }
其實(shí)我想做的是加載進(jìn)度條效果,但是假的進(jìn)度條太爛,真的又沒(méi)有特別好的辦法,判斷圖片這種總感覺(jué)比較漏。
這是代碼,有完美解決方案了解決。
<script> document.onreadystatechange=function(){ if(document.readyState=='complete'){ $('.loading').fadeOut(); } } </script>
總結(jié)
以上所述是小編給大家介紹的HTML5等待加載動(dòng)畫(huà)效果,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
標(biāo)簽:惠州 紅河 萍鄉(xiāng) 蘇州 營(yíng)口 咸陽(yáng) 甘南 文山
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《HTML5等待加載動(dòng)畫(huà)效果》,本文關(guān)鍵詞 HTML5,等待,加載,動(dòng)畫(huà),效果,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。