After doing long project work I feel so board and exhausted. For refreshing my mind I thought to make something funny with CSS3 and write a blog on it. Last day, worked on CSS3 animation section in my project and did a good job. I’d modified my some codes in that script and made Facebook like loading animation.
Personally I feel css3 has awesome power and more flexible then JavaScript libraries. Also CSS3 effects looks great and loaded fast rather then JavaScript. May be one day css3 will replace JavaScript libraries. In this loading animation I’d used simple css3 properties. Such as- animation-name, animation-duration, animation-iteration-count etc. Remember CSS3 only supported by latest browsers. This script has been tested and it's working in the latest versions of Firefox, Chrome and Safari. Don’t try to run it in IE6 :P
Enjoy!
@-webkit-keyframes fb_loading {
0% { opacity: 1; }
100% { opacity: 0; }
}
@-moz-keyframes fb_loading {
0% { opacity: 1; }
100% { opacity: 0; }
}
p#facebook_loading {
text-align: center;
margin: 100px 0 0 0;
}
#facebook_loading span {
-webkit-animation-name: fb_loading;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-moz-animation-name: fb_loading;
-moz-animation-duration: 1s;
-moz-animation-iteration-count: infinite;
font-weight: bold;
font-size:3px;
border: 1px solid black;
margin-right: 1px;
padding: 1px 1px 1px 1px;
background: lightgray;
}
#facebook_loading span:nth-child(1) {
-webkit-animation-delay: 100ms;
-moz-animation-delay: 100ms;
}
#facebook_loading span:nth-child(2) {
-webkit-animation-delay: 150ms;
-moz-animation-delay: 150ms;
}
#facebook_loading span:nth-child(3) {
-webkit-animation-delay: 250ms;
-moz-animation-delay: 250ms;
}
Just add following simple html code in your page.
Was this information useful? What other tips would you like to read about in the future? Share your comments, feedback and experiences with us by commenting below!
You might also like...
Create a cool CSS3 Pricing table less then 15 min
popular css frameworks for modern web layout design
3 steps to create a simple tooltip box
Md Mahbub Alam Khan is the Editor and Founder of CoolAJAX Web Blog. You can follow CoolAJAX on Twitter , on Facebook or you can subscribe via RSS .
Topics