Filling up a circle progress bar [closed]

你离开我真会死。 提交于 2019-12-13 08:25:51

问题


I've search this website with multiple progressive circle sample but did not find similar to my requirement.

I'm trying to create progress circle filled from bottom to top. The % percent value will pass from textbox.


回答1:


You could handle the animation with transforms and transitions : (Hover the circle)

#count{
    position:relative;
    border-radius:50%;
    overflow:hidden;
    line-height:200px;
    width:200px;
    text-align:center;
    background:#000;
    color:#fff;
    z-index:1;
}
#count span{
    position:absolute;
    top:0; left:0;
    width:100%; height:100%;
    background: red;
    z-index:-1;
    transform:scaleY(0.001);
    transition:transform 3s;
    transform-origin:50% 100%;
}
#count:hover span{
    transform:scaleY(1);
}
<div id="count">100%<span></span></div>



回答2:


Try to create the orange "growing" part like this:

JsFiddle

JavaScript

The point here is simply resizing the orange rectangle.

function resize(i) {
    console.log(i);
    jQuery('#loadRec').height(i%100);
    i++;
}

Black background and white foreground will be static individual shapes.



来源:https://stackoverflow.com/questions/30138369/filling-up-a-circle-progress-bar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!