Rotate animations with CSS for page loading

Source: Internet
Author: User

Sometimes browse some sites when the page just loaded a scrolling animation, especially for some mobile site or hybrid applications should be a lot better user experience, grilled the next page found to be using CSS style control, so the page and CSS style to assign the value down,

HTML as follows

<id= "Page-loader"  class= "Fade in"><  class = "Spinner" ></ span ></ Div >

CSS styles are as follows

@-webkit-keyframes Rotation{From {-webkit-transform:Rotate (0deg)} to{-webkit-transform:Rotate (359deg)}}@-moz-keyframes Rotation{From {-moz-transform:Rotate (0deg)} to{-moz-transform:Rotate (359deg)}}@-o-keyframes Rotation{From {-o-transform:Rotate (0deg)} to{-o-transform:Rotate (359deg)}} @keyframes Rotation{From {transform:Rotate (0deg)} to{Transform:Rotate (359deg)}}.fade.in{Filter:Alpha (opacity=100);}. fade.in{Opacity:1;}. Fade{Opacity:0;Filter:Alpha (opacity=0);-webkit-transition:opacity. 3s linear;transition:opacity. 3s linear;}. Fade{Opacity:0;-webkit-transition:opacity. 15s Linear;-o-transition:opacity. 15s Linear;transition:opacity. 15s Linear;}. fade.in. Spinner,. fade.in. Spinner-small{-webkit-animation:rotation. 6s Infinite linear;-moz-animation:rotation. 6s Infinite linear;-o-animation:rotation. 6s Infinite linear;Animation:rotation. 6s Infinite linear;}. Spinner{Height:40px;width:40px;position:Absolute;Top:50%; Left:50%;margin:-20px-20px 0 0;Border:2px solid #fff;Border-top:2px solid #24B498;Border-radius:100%;}#page-loader.fade.in{Display:Block;}#page-loader.fade{Display:None;}#page-loader{position:fixed;Top:0; Left:0;Bottom:0; Right:0;background:#E6E8EC;}

The effect is out, but do not forget the page loaded after the hidden amount, or it will always go to the dawn, can not stop!

document.getElementById (' Page-loader '). Classname= ' fade 'jquery code is as follows $ (' #page-loader '). Removeclass (' in ');

Does this feel much better when the page loads or asynchronously submits the form? Whether you believe it or not, I believe it anyway.

Rotate animations with CSS for page loading

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.