Using CSS3 Animation simulation to achieve small ball free fall effect

Source: Internet
Author: User

Use pure CSS Code simulation to achieve the small ball freefall effect:

The HTML code is as follows:

1 <  ID= "Balldiv">2<id= "Ball "></div>3</div>    

CSS style code:

/*Ball Style*/#ballDiv{Height:400px;Background-color:#333333;}#ball{width:100px;Height:100px;Border-radius:50%;background:-webkit-radial-gradient (center center,circle, #fff, blue);Box-shadow:3px 7px 8px #ccc;-webkit-animation:Ball 5s Cubic-bezier (0.0,0.25,0.50,1.0);-webkit-transform:Translate (250px, 300px);}@-webkit-keyframes Ball{0%{-webkit-transform:Translate (0, 0);}10%{-webkit-transform:Translate (0, 330px);Height:70px;}20%{-webkit-transform:Translate (50px, 50px);Height:100px;}30%{-webkit-transform:Translate (50px, 330px);Height:70px;}40%{-webkit-transform:Translate (100px, 100px);Height:100px;}50%{-webkit-transform:Translate (100px, 320px);Height:80px;}60%{-webkit-transform:Translate (150px, 150px);Height:100px;}70%{-webkit-transform:Translate (150px, 320px);Height:80px;}80%{-webkit-transform:Translate (200px, 200px);Height:100px;}90%{-webkit-transform:Translate (200px, 300px);Height:100px;}100%{-webkit-transform:Translate (250px, 300px);Height:100px;}}

Using CSS3 Animation simulation to achieve small ball free fall effect

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.