【发布时间】:2017-04-30 23:27:25
【问题描述】:
使用 jquery-circle-progress 插件,我如何制作一个可以计数到确定数字的计数器,并且该数字应该从 HTML 标记中获取。我已经做到了,但它不能工作!
<div class="circle" data-value="0.75" data-thickness="04"> <span>6587</span> </div>
<script>
$('.circle').circleProgress({
fill: {gradient: ['red', 'orange']},
startAngle: -Math.PI / 2,
size: 133
}).on('circle-animation-progress', function(event, progress) {
var x = parseInt($('.circle span').text());
$(this).find('span').html(Math.round(x*progress));
});
</script>
【问题讨论】:
-
到目前为止你尝试过什么?向我们展示您的代码。
标签: jquery progress-bar counter