HTML5-Å ã ä~è ¥ ***************************************************************
***************************
1) ~~~â ~öá~~~~~çó ?¶ Ó ó Ó
// Á ÷ Ð çvar MeteorRain = function () {this. x =-1; this. y =-1; this. length =-1; // the value of this parameter. angle = 30; // Ç ã Ð ± ½ Ç %this. width =-1. height =-1; // the value of this parameter. speed = 1; // specify another parameter. offset_x =-1; // ° áöááò ¶ ¯ Æ «Ò á¿ ¿this. offset_y =-1; // ×ö öáò ¶ ¯ Æ «Ò á á¿ this. alpha = 1; // í~~~~=this. colZ classification · classification" http://www.bkjia.com/kf/ware/vc/ "Target =" _ blank "class =" keylink "> vcjEgPSA =" "; // Á ÷ Ç çmicroäé «² limit this. color2 = ""; // á÷ Ð çmicroäé «2 * * ******************/this. init = function () // has been completed successfully» has {this. getPos (); this. alpha = 1; // í~~~~=this. getRandomColor (); // ×~~~~~~~%%%%%%%%%%%%%%%%%%%%%%%%var x = Math. random () * 80 + 150; this. length = Math. ceil (x); // x = Math. random () * 10 + 30; this. angle = 30; // Á ÷ Ð çç?± ± ½ çx = Math. random () + 0.5; this. speed = Math. ceil (x); // á~~~~~~~=var cos = Math. cos (this. angle * 3.14/180); var sin = Math. sin (this. angle * 3.14/180); this. width = this. length * cos; // Á ÷ Ç ç?ù Õ ****í ***this. height = this. length * sin; // á~~~~~~~~~~%this. offset_x = this. speed * cos; this. offset_y = this. speed * sin ;} /*****************» añé ********* * *******/this. getRandomColor = function () {var a = 255 * Math. random (); a = Math. ceil (a); var a1 = 255 * Math. random (); a1 = Math. ceil (a1); var a2 = 255 * Math. random (); a2 = Math. ceil (a2); // ö~~~añé «this. color1 = "rgba (" +. toString () + "," + a1.toString () + "," + a2.toString () + ", 1)"; // maquámäañé «this. color2 = "black ";} ** * ***************/this. countPos = function () // {// Í ù ×ó Ï Â Ò Æ ¶ ¯, x ¼ É £ £%y ö ö¼ ó this. x = this. x-this. offset_x; this. y = this. y + this. offset_y ;} /*******************» aí??= **** * ************/this. getPos = function () // {// ° á×ø ± limit 200 -- 1200 var x = Math. random () * 1000 + 400; this. x = Math. ceil (x); x = Math. random () * 600; // ×ý ×ø ± ê ¡Ó óú600 this. y = Math. ceil (x );} /*****» mömámámámá÷ ç *************************** /this. draw = function () //» Ö öæ Ò» ö öá÷ Ç çμä° ¯ Ê ý {context. save (); context. beginPath (); context. lineWidth = 3; context. globalAlpha = this. alpha «, limit limit μ limit × ø ± Ö öáöölimit limit μ limit × ø ± limit var line = context. createLinearGradient (this. x, this. y, this. x + this. width, this. y-this. height); // · ö~*********** line. addColorStop (0, "white"); line. addColorStop (0.1, this. color1); line. addColorStop (0.6, this. color2); context. strokeStyle = line; // optional parameter μ character context. moveTo (this. x, this. y); // öõ µã context. lineTo (this. x + this. width, this. y-this. height); context. closePath (); context. stroke (); context. restore ();} this. move = function () {// Ç å ¿á÷ Ç çaden Ë Ø var x = this. x + this. width-this.offset_x; var y = this. y-this.height; context. clearRect (X-3, Y-3, this. offset_x + 5, this. offset_y + 5); // context. strokeStyle = "red"; // context. strokeRect (x, Y-1, this. offset_x + 1, this. offset_y + 1); // öø Ð Â ¼ Ë ã û ö~£******************** this. countPos (); // í~~~~~~ö~óthis. alpha-= 0.002; // öø» please this. draw ();}} ~~~~~~ón' × {'? ± äé» £ ********************************************
» *********************************************************** ° Íçá ~~%£%%%%%%%%%%%%%%%%%%» %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2) Please refer to ~~~~~~~é ~öá~~ço
~Úonload {à ~~ö~~~~~~£°
// È «¾ ö± äáw.var rains = new Array (); var rainCount = 20; // onload à À ~~ö~********** // Á ~************ for (var I = 0; I Function playRains () {for (var n = 0; n <rainCount; n ++) {var rain = rains [n]; rain. move (); // specify when else if (rain. y> 600) {// ³ ¬ ö öç çor° ° óöø À 'Context. clearRect (rain. x, rain. y-rain.height, rain. width, rain. height); rains [n] = new MeteorRain (); rains [n]. init () ;}} setTimeout ("playRains ()", 50) ;}» ° ó~úonload ö~~~~~~~â ~£°
PlayRains (); 4) ***************************************************************
Please refer to the following link for more information ¡