JavaScript animation Grandpa Hair flying all over the sky

Source: Internet
Author: User

var minsize=50;
var maxsize=100;
var newon=200;
var flakecolor= "#fff";
var flak=$ ("<div></div>"). css ({"position": "Absolute", "Top": " -50px"}). html ("</img> ");
$ (function () {
var dheight=$ (document). Height ();//Gets the height of the screen
var dwidth=$ (document). width ();//Gets the width of the screen
SetInterval (function () {
var startpostion=math.random () *dwidth;//position
var startopacity=0.7+math.random () *0.3;//Transparency
var endpositiontop=dheight;//height
var endpositionleft=math.random () *dwidth;//generates a left random number
var durationfall=2000+math.random () *3000;//time
var sizefalsk=minsize+math.random () *maxsize;//size
Flak.clone (). AppendTo ("Body"). CSS ({//copy
"Left": startpostion,
"Opacity": startopacity,
"FontSize": Sizefalsk,
"BackgroundColor": Flakecolor

}). animate ({//animation
"Top": endpositiontop,
"Left": Endpositionleft,
"Opacity": 0.5
},durationfall,function () {$ (this). Remove ();}); /Remove Events


},newon);





});

Please leave your e-mail if needed

JavaScript animation Grandpa Hair flying all over the sky

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.