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實現旋轉loadding載入效果CSSS3
- CSS3實現的頁面載入等待效果CSSS3
- CSS3實現的loadding載入等待效果CSSS3
- css3實現的旋轉的陀螺效果CSSS3
- css3實現的立方體旋轉效果CSSS3
- css3實現環狀旋轉效果CSSS3
- CSS3實現的環形旋轉載入補全效果程式碼例項CSSS3
- CSS3載入等待動畫效果CSSS3動畫
- CSS3實現的3D旋轉效果CSSS33D
- CSS3邊框旋轉動畫實現效果CSSS3動畫
- jQuery和css3實現的摩天輪旋轉效果jQueryCSSS3
- | / - 的旋轉效果實現(轉)
- CSS3五連珠載入等待效果CSSS3
- 旋轉等待內容載入完畢實現程式碼例項
- css3實現的3D立體旋轉效果CSSS33D
- css3實現的旋轉魔方效果程式碼例項CSSS3
- css3實現的立方體3D旋轉效果CSSS33D
- js和css3實現的載入等待特效JSCSSS3特效
- js和css3實現360旋轉滾動效果JSCSSS3
- CSS3實現的div元素旋轉一定角度效果CSSS3
- CSS3 旋轉魔方效果CSSS3
- SVG實現的圓環旋轉效果SVG
- css3實現旋轉的太極圖效果程式碼例項CSSS3
- CSS3圖片旋轉效果CSSS3
- CSS3多面體旋轉效果CSSS3
- CSS3星系旋轉效果代CSSS3
- CSS3 loadding旋轉等待動畫CSSS3動畫
- css3實現的loadding載入動畫效果CSSS3動畫
- css3實現動態摺疊生成立方體旋轉效果CSSS3
- canvas小球旋轉loadding載入效果Canvas
- CSS3 圓環內部旋轉效果CSSS3
- CSS3地月星系旋轉效果CSSS3
- canvas實現的旋轉太極圖效果Canvas
- css3實現橢圓軌跡旋轉CSSS3