我有一个圆形的进度条,我想根据百分比更改进度条的颜色,但似乎做不到(使用jsp)

JQUERY

我想根据获得的百分比更改进度条的颜色。我试过像这样将它放在jquery本身中,但是不起作用。

$(el).circleProgress({fill : {color : '<%= colorCode %>'}}).on('circle-animation-progress',function(event,progress,stepValue)

function Circlle(el)
{
    $(el).circleProgress().on('circle-animation-progress',stepValue)
    {
        if(stepValue >= 1)
        {
            $(this).find('strong').text('100%');
            $(this).css('color','forestgreen');
        }
        else
        {
            $(this).find('strong').text(String(stepValue.toFixed(2)).substr(2)+'%');
            if(stepValue >= 0.8)
                $(this).css('color','forestgreen');
            else if(stepValue >= 0.6)
                $(this).css('color','lightgreen');
            else if(stepValue >= 0.4)
                $(this).css('color','yellow');
            else if(stepValue >= 0.2)
                $(this).css('color','orange');
            else
                $(this).css('color','red');
        }
    });  
};
});
Circlle('.round');

HTML

<div class="round" data-value="<%= pct %>" data-size="100" data-thickness="5">
    <strong></strong>                 
</div>
wyaacc 回答:我有一个圆形的进度条,我想根据百分比更改进度条的颜色,但似乎做不到(使用jsp)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3112644.html

大家都在问