There is also a saying that the lottery turntable is generally set by a circle panel with many awards. in front of the circle panel, there is also a pointer that is fixed. below, I will share with you the mobile phone turntable lottery. if you need it, you can refer to the following demo:
I am not talking nonsense. I am posting code directly to you.
Html section
Css part. because the turntable is made on the mobile phone end, the response layout is adopted.
.turntableWap{ padding:1rem; background:url(../images/zpTabBg.jpg) no-repeat center; background-size:100% 100%;}.turntableWap table{ width:100%;}.turntableWap table td{ vertical-align:middle; text-align:center; background-color:#ecd295;}.turntableWap table td img{ width:100%; }.turntableWap table td.even{background-color:#f6e8c5}.turntableWap table td.active{ background-color:#ed9351;}
Js section
$ (". TurntableWap. table "detail .css ({" height ": $ (". turntableWap. table "). width ()}); // Make a responsive layout. the outer table is var isdo = true; $ (". zpBtn "). on ("click", function () {var num = 13; // The Prize var rotaNum = 14 in the background; // The number of prizes var count =-1; // highlight, rotation effect var jishi = 0; // Time range var speed = 50; // fast speed var speedSlow = 200; // slow speed choujiang () // call the Lottery method. choujiang () is called for judgment, and the function choujiang () {if (isdo) {isdo = false; $ (". turntableWap ").css ({" background-image ":" url (.. /images/1.gif) "}) var c = setInterval (function () {if (count> 12) {count =-1;} count = count + 1; jishi = jishi + 1; $ (". turntableWap td "). removeClass ("active"); $ (". turntableWap td [tag = "+ count +"] "). addClass ("active"); if (jishi> rotaNum * 2) {clearInterval (c); c = setInterval (function () {count = count + 1; jishi = jishi + 1; $ (". turntableWap td "). removeClass ("active"); $ (". turntableWap td [tag = "+ count +"] "). addClass ("active"); if (jishi> num + rotaNum * 2) {clearInterval (c); $ (". turntableWap ").css ({" background-image ":" url (.. /images/zpTabBg.jpg) "}) isdo = true; var jp = $ (". turntableWap td [tag = "+ count +"] "). find ("img "). attr ("alt") alert ("Congratulations! Get It" + jp) }}, speedSlow) }}, speed)} else {return ;}}})
The above is the code for the mobile phone turntable lottery, which we will share with you.