Javascript simulated lottery order effect implementation code _ game entertainment

Source: Internet
Author: User
The JS lottery simulation effect sounds incredible. If you don't have high requirements for the lottery, maybe this small lottery program will help you a lot, because it is really practical. I think webpage special effects are good. If you are interested, refer

<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> JS simulated Lucky Draw effect </TITLE> <style type = "text/css">. a1 {position: relative; font-family: Verdana; font-size: 20px; color: #888888 ;}</style> <script language = "JavaScript"> function lotto () {if (! Document. all &&! Document. layers) return for (j = 1; j <48; j ++) // stop zero !? {Var a = Math. round (Math. random () * j + 1); var B = Math. round (Math. random () * j + 1); var c = Math. round (Math. random () * j + 1); var d = Math. round (Math. random () * j + 1); var e = Math. round (Math. random () * j + 1); var f = Math. round (Math. random () * j + 1);} var x = new Array (a, B, c, d, e, f ); if (x [0] = x [1]) | (x [0] = x [2]) | (x [0] = x [3]) | (x [0] = x [3]) | (x [0] = x [5]) | (x [1] = x [2]) | (x [1] = x [3]) | (x [1] = x [4]) | (X [1] = x [5]) | (x [2] = x [3]) | (x [2] = x [4]) | (x [2] = x [5]) | (x [3] = x [4]) | (x [3] = x [5]) | (x [4] = x [5]) | (x [5] = x [4]) lotto (); // restart else {var y = x. toString (); var z = y. split (','); for (I = 0; I <z. length; I ++) {z [I] = z [I] + ""; if (z [I]. length <3) // add '0' to singles z [I] = "0" + z [I] + "";} z = z. sort (); Nos = z [0] + z [1] + z [2] + z [3] + z [4] + z [5]; if (document. all) {document. all. la Yer1.innerHTML = Nos;} // or z! Else if (document. layers) {document.layers.layer1.doc ument. open (); document.layers.layer1.doc ument. write ("" + Nos + ""); document.layers.layer1.doc ument. close () ;}t = setTimeout ('lotto () ', 10 );}} // --> script </HEAD> <BODY> <table border = '0' width = 250 height = 50> <tr valign = 'middle'> <td align = 'center'> Result </td> </tr> </table> </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.