Javascript animation Grandpa Mao is full of days, javascript is full of days

Source: Internet
Author: User

Javascript animation Grandpa Mao is full of days, javascript is full of days
Var minSize = 50;
Var maxSize = 100;
Var newOn = 200;
Var flakeColor = "# fff ";
Var flak = $ ("<div> </div>" ).css ({"position": "absolute", "top ": "-50px" 00000000.html (" </img> ");
$ (Function (){
Var dheight = $ (document). height (); // get the height of the screen
Var dwidth = $ (document). width (); // obtain the screen width
SetInterval (function (){
Var startPostion = Math. random () * dwidth; // location
Var startOpacity = 0.7 + Math. random () * 0.3; // transparency
Var endPositionTop = dheight; // height
Var endPositionLeft = Math. random () * dwidth; // generates a random number on the left.
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 an event


}, NewOn );





});

If necessary, leave your email

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.