Summary
In web development, in order to improve the user experience, when loading the data will give a loading hint.
Html
<!DOCTYPE HTML><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <title></title> <Scriptsrc= "Http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></Script> <style>. Cssload-container{width:24px;Height:24px;position:fixed;Top:260px; Left:50%;Margin-left:-12px; }. Cssload-speeding-wheel{width:60px;Height:60px;margin:0 Auto;Border:2px solid Rgba (0,0,0,0.25);Border-radius:50%;Border-left-color:Transparent;Border-right-color:Transparent;Animation:cssload-spin 575ms Infinite linear;-o-animation:cssload-spin 575ms Infinite linear;-ms-animation:cssload-spin 575ms Infinite linear;-webkit-animation:cssload-spin 575ms Infinite linear;-moz-animation:cssload-spin 575ms Infinite linear; }@keyframes Cssload-spin{100% {Transform:Rotate (360deg);Transform:Rotate (360deg); }} @-o-keyframes Cssload-spin{100% {-o-transform:Rotate (360deg);Transform:Rotate (360deg); }} @-ms-keyframes Cssload-spin{100% {-ms-transform:Rotate (360deg);Transform:Rotate (360deg); }} @-webkit-keyframes Cssload-spin{100% {-webkit-transform:Rotate (360deg);Transform:Rotate (360deg); }} @-moz-keyframes Cssload-spin{100% {-moz-transform:Rotate (360deg);Transform:Rotate (360deg); } } </style></Head><Body> <Divclass= "Cssload-container"> <Divclass= "Cssload-speeding-wheel"></Div> </Div> <Script> functionshowloading () {$ (". Cssload-container"). Show (); }; functionhideloading () {$ (". Cssload-container"). Hide (); }; var Times= 1; SetInterval (function () { if( times% 2 === 0) {hideloading (); } Else{showloading (); }; Times++; }, -) </Script></Body></HTML>
Effect
Paste in the required CSS and put the code on the page that needs to be displayed.
<class= "Cssload-container"> <class = "Cssload-speeding-wheel"></div> </ Div >
Control display and Hidden JS
function showloading () { $ (". Cssload-container"). Show (); }; function hideloading () { $ (". Cssload-container"). Hide (); };
A simple and practical CSS loading icon