6
我試圖創建一個百分比計數器,但它沒有做我需要的東西。它只顯示100%。不過,我需要一步一步顯示所有0到100%!我應該如何改變它?如何在jQuery中創建百分比計數器?
setInterval(function per(p = 0) {
for (p = 1; p <= 100; p++) {
$(".percentage").text(p + "%");
}
}, 1000);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p class="percentage"></p>
感謝youuuuuuuuuuuuuuuuuuuuuuuuuu :) –