Javascript pure numbers stop the implementation code of the display effect one by one. js digital code

Source: Internet
Author: User

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.

Related Article

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.