Javascript pure numbers stop the implementation code of the display effect one by one. js digital code
Implementation Code of js pure numbers to stop Display Results one by one
Function showScore ($ ele, num, secand, pause) {// second: the number of seconds for the animation to run. if (! Secand) {secand = 2;} if (! Pause) {pause = 20;} var len = String (num ). length; var temnum, times = 0, stepTimes, max; var numArr = String (num ). split (""); function getRandom (n) {var num = Math. floor (Math. random () * (Math. pow (10, n)-1-Math. pow (10, n-1) + Math. pow (10, n-1); if (String (num ). length! = N) {num = getRandom (n);} return num;} function setValue (num, pause, secand) {// how many seconds does second stop var len = String (num ). length, j = 0; if (! StepTimes) {max = Math. ceil (secand * 1000/len); stepTimes = Math. ceil (max/pause);} temnum = ""; setTimeout (function () {for (var I = 1; I <= len; I ++) {if (times> = stepTimes * I) {j ++; temnum + = numArr [I-1] + ";}else {break ;}; if (j <len) {export ele.html (temnum + "" + getRandom (len-j);} else {export ele.html (temnum);} if (times> = max | j> = len) {return ;}; setValue (num, pause, secand); times ++ ;}, pause) ;}setvalue (num, pause, secand) ;}showscore ($ (". num "), 2344, 1.5, 10 );
A pure number indicates that the display effect is stopped one by one. For example, if this number keeps changing, the first digit is determined first, the second digit is determined, and the third digit is determined. Because the project has been deprecated for several days, the archive is saved.
The implementation code of the above js pure numbers one by one to stop the display effect is all the content shared by xiaobian. I hope you can give us a reference and support for the help house.