css3實現的旋轉載入等待效果
本章節分享一段程式碼例項,它實現了旋轉載入等待效果。
比如win10系統,或者其他的什麼效果都有類似的實現,程式碼例項如下:
[HTML] 純文字檢視 複製程式碼<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>螞蟻部落</title> <style> /*css reset */ body, p, div, ol, ul, li, dl, dt, dd, h1, h2, h3, h4, h5, h6, form, input, iframe, nav { margin: 0; padding: 0; } .wrapper { width: 1000px; margin: 200px auto; } .windows8 { position: relative; width: 44px; height: 44px; margin: auto; } .windows8 .wBall { position: absolute; width: 42px; height: 42px; opacity: 0; transform: rotate(225deg); -o-transform: rotate(225deg); -ms-transform: rotate(225deg); -webkit-transform: rotate(225deg); -moz-transform: rotate(225deg); animation: orbit 3.6325s infinite; -o-animation: orbit 3.6325s infinite; -webkit-animation: orbit 3.6325s infinite; -moz-animation: orbit 3.6325s infinite; } .windows8 .wBall .wInnerBall { position: absolute; width: 5px; height: 5px; background: rgb(0,0,0); left: 0px; top: 0px; border-radius: 5px; } .windows8 #wBall_1 { animation-delay: 0.796s; -o-animation-delay: 0.796s; -webkit-animation-delay: 0.796s; -moz-animation-delay: 0.796s; } .windows8 #wBall_2 { animation-delay: 0.153s; -o-animation-delay: 0.153s; -webkit-animation-delay: 0.153s; -moz-animation-delay: 0.153s; } .windows8 #wBall_3 { animation-delay: 0.3165s; -o-animation-delay: 0.3165s; -webkit-animation-delay: 0.3165s; -moz-animation-delay: 0.3165s; } .windows8 #wBall_4 { animation-delay: 0.4695s; -o-animation-delay: 0.4695s; -webkit-animation-delay: 0.4695s; -moz-animation-delay: 0.4695s; } .windows8 #wBall_5 { animation-delay: 0.633s; -o-animation-delay: 0.633s; -webkit-animation-delay: 0.633s; -moz-animation-delay: 0.633s; } @keyframes orbit { 0% { opacity: 1; z-index: 99; transform: rotate(180deg); animation-timing-function: ease-out; } 7% { opacity: 1; transform: rotate(300deg); animation-timing-function: linear; } 30% { opacity: 1; transform: rotate(410deg); animation-timing-function: ease-in-out; } 39% { opacity: 1; transform: rotate(645deg); animation-timing-function: linear; } 70% { opacity: 1; transform: rotate(770deg); animation-timing-function: ease-out; } 75% { opacity: 1; transform: rotate(900deg); animation-timing-function: ease-out; } 76% { opacity: 0; transform: rotate(900deg); } 100% { opacity: 0; transform: rotate(900deg); } } @-o-keyframes orbit { 0% { opacity: 1; z-index: 99; -o-transform: rotate(180deg); -o-animation-timing-function: ease-out; } 7% { opacity: 1; -o-transform: rotate(300deg); -o-animation-timing-function: linear; } 30% { opacity: 1; -o-transform: rotate(410deg); -o-animation-timing-function: ease-in-out; } 39% { opacity: 1; -o-transform: rotate(645deg); -o-animation-timing-function: linear; } 70% { opacity: 1; -o-transform: rotate(770deg); -o-animation-timing-function: ease-out; } 75% { opacity: 1; -o-transform: rotate(900deg); -o-animation-timing-function: ease-out; } 76% { opacity: 0; -o-transform: rotate(900deg); } 100% { opacity: 0; -o-transform: rotate(900deg); } } @-ms-keyframes orbit { 0% { opacity: 1; z-index: 99; -ms-transform: rotate(180deg); } 7% { opacity: 1; -ms-transform: rotate(300deg); } 30% { opacity: 1; -ms-transform: rotate(410deg); } 39% { opacity: 1; -ms-transform: rotate(645deg); } 70% { opacity: 1; -ms-transform: rotate(770deg); } 75% { opacity: 1; -ms-transform: rotate(900deg); } 76% { opacity: 0; -ms-transform: rotate(900deg); } 100% { opacity: 0; -ms-transform: rotate(900deg); } } @-webkit-keyframes orbit { 0% { opacity: 1; z-index: 99; -webkit-transform: rotate(180deg); -webkit-animation-timing-function: ease-out; } 7% { opacity: 1; -webkit-transform: rotate(300deg); -webkit-animation-timing-function: linear; } 30% { opacity: 1; -webkit-transform: rotate(410deg); -webkit-animation-timing-function: ease-in-out; } 39% { opacity: 1; -webkit-transform: rotate(645deg); -webkit-animation-timing-function: linear; } 70% { opacity: 1; -webkit-transform: rotate(770deg); -webkit-animation-timing-function: ease-out; } 75% { opacity: 1; -webkit-transform: rotate(900deg); -webkit-animation-timing-function: ease-out; } 76% { opacity: 0; -webkit-transform: rotate(900deg); } 100% { opacity: 0; -webkit-transform: rotate(900deg); } } @-moz-keyframes orbit { 0% { opacity: 1; z-index: 99; -moz-transform: rotate(180deg); -moz-animation-timing-function: ease-out; } 7% { opacity: 1; -moz-transform: rotate(300deg); -moz-animation-timing-function: linear; } 30% { opacity: 1; -moz-transform: rotate(410deg); -moz-animation-timing-function: ease-in-out; } 39% { opacity: 1; -moz-transform: rotate(645deg); -moz-animation-timing-function: linear; } 70% { opacity: 1; -moz-transform: rotate(770deg); -moz-animation-timing-function: ease-out; } 75% { opacity: 1; -moz-transform: rotate(900deg); -moz-animation-timing-function: ease-out; } 76% { opacity: 0; -moz-transform: rotate(900deg); } 100% { opacity: 0; -moz-transform: rotate(900deg); } } </style> </head> <body> <div class="wrapper"> <div class="windows8"> <div class="wBall" id="wBall_1"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_2"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_3"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_4"> <div class="wInnerBall"></div> </div> <div class="wBall" id="wBall_5"> <div class="wInnerBall"></div> </div> </div> </div> </body> </html>
相關文章
- CSS3旋轉載入等待效果CSSS3
- CSS3載入等待動畫效果CSSS3動畫
- CSS3五連珠載入等待效果CSSS3
- CSS3 loadding旋轉等待動畫CSSS3動畫
- CSS3多面體旋轉效果CSSS3
- CSS3星系旋轉效果代CSSS3
- CSS3圖片旋轉效果CSSS3
- CSS3地月星系旋轉效果CSSS3
- 簡單的css3頭像旋轉與3D旋轉效果CSSS33D
- CSS3旋轉風車效果程式碼CSSS3
- CSS3滑鼠懸浮div旋轉效果CSSS3
- CSS3旋轉效果程式碼例項CSSS3
- 使用css3做一個魔方旋轉的效果CSSS3
- 滑鼠懸浮div實現旋轉效果
- jQuery環形旋轉載入進度條效果jQuery
- CSS3旋轉大風車效果詳解CSSS3
- css3實現橢圓軌跡旋轉CSSS3
- 滑鼠懸浮實現環形旋轉效果
- HTML+CSS實現太極旋轉效果HTMLCSS
- CSS3立方體3D旋轉效果CSSS33D
- 手寫一個使用css3旋轉硬幣的效果CSSS3
- CSS3 loadding載入效果CSSS3
- CSS3 loadding載入動畫效果CSSS3動畫
- css3帶你實現3D轉換效果CSSS33D
- 頁面正在載入執行loding等待效果
- 卡片旋轉動畫效果動畫
- 影像旋轉的FPGA實現(一)FPGA
- CSS3動畫(360度旋轉、旋轉放大、放大、移動)CSSS3動畫
- CSS3翻轉效果CSSS3
- Android 自定義圓形旋轉進度條,仿微博頭像載入效果Android
- CSS3實現多種背景效果CSSS3
- CSS3實現多樣的邊框效果CSSS3
- 頁面旋轉動畫效果動畫
- php實現圖片旋轉PHP
- 直播軟體原始碼,CSS3實現圖片立體旋轉動畫原始碼CSSS3動畫
- vue實現首屏載入等待動畫 避免首次載入白屏尷尬Vue動畫
- CSS3提交按鈕等待打點迴圈效果CSSS3
- 純CSS3屬性animation實現的打字效果CSSS3
- CSS3實現3D魔方效果CSSS33D