I have this code for a progress bar but My code looks like this How can I get rid of it for decades? Is it even possible that one percent increases? It is getting very fast now. - ---------------------------------- Edited ------- -------- -------------------- With the reply of Brar, I have completed the code, if anyone Here's the solution: to specify the number of will display 1 digit after the decimal point. . Progress-label showing too many decimals, something like (2.020302032400%).
& lt; Script & gt; $ (Document) .ready (function () {$ ("# progressbar"). Progressbar ({value: 1}); $ ("# progressbar> .ui-progressbar-value"). Animate ({width: "37%"}, {step: function (width) {$ ('progress-label'). Text (width + '%');}}, 2000);}); & Lt; / Script & gt;
$ (document) .ready (function () {$ ("# progressbar"). Progressbar ({value: 1}); $ (" {Progressbar> .ui-progressbar-value "). {Width:" 37% "}, {duration: 10000, step: action (width) {$ ('progress-label'). Text (width.toFixed ( 0) + "%")}}}})});
toFixed () method Use decimal places.
$ ('Progress-label'). Text (width.toFixed (1) + '%'); }
No comments:
Post a Comment