简体   繁体   中英

Semantic UI progress bar reset

I was trying to use the Semantic UI progress bar as a vote/poll graph. When I tried resetting the data-value to zero, the progress bar would not animate and change back to zero.

$('#choiceA').progress({value:0, total:0});

It seems like setting value to some extremely small number makes the animation work though:

$('#choiceA').progress({value:0.00000001, total:0});

Is this an acceptable fix to the problem? Or is there a better way to do this.

edit: seems like the issue has been brought up here https://github.com/Semantic-Org/Semantic-UI/issues/1395

You can try

$('.ui.progress').progress('reset');

taken from here to reset the progress bar.

尝试将百分比设置为0

$('.ui.progress.black').progress({percent: 0});

Set progress percent 0:

$('#choiceA').progress({
  percent: 0
});

or use

$('#choiceA').progress('reset');

Here is working fiddle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM