我使用了几个插件来使用JavaScript为进度条设置动画效果。获取每个div的数据值
我在HTML中设置每个数据值以避免每次都在JavaScript中定义它。
<div class="progress-circle" data-value="0.65">
我想要得到的数据值,每一次,但我此刻的代码将停止所有的人都在第1 div的值设置动画,并在该值停止。
var el = $('.progress-circle'),
inited = false;
el.appear({ force_process: true });
el.on('appear', function() {
if (!inited) {
el.circleProgress({ value: el.attr('data-value') });
inited = true;
}
});
$('.progress-circle').circleProgress({
size: 80,
startAngle: -Math.PI/4 * 2,
lineCap: "round",
fill: { color: "#64B46E" }
}).on('circle-animation-progress', function(event, progress, stepValue) {
$(this).find('.inner').text(String(stepValue.toFixed(2)).substr(2)+ '%');
});
我怎样才能得到这个使用每个div独特的数据值属性?