Is there a way to show the percentage number insid

2019-03-22 02:27发布

Does jQuery UI support showing the number inside the Progressbar, like this:

alt text

2条回答
我想做一个坏孩纸
2楼-- · 2019-03-22 02:52

If it isn't any official way, you can add it. Just inspect the generated code with FireBug on Mozzila, get the id/class of the container and add the numbers in there yourself.

I never used jQuery UI's progressbar so I can't do that right now, but I'm sure it's not hard...

查看更多
手持菜刀,她持情操
3楼-- · 2019-03-22 03:10

Not to drudge up an old thread, but I was attempting this earlier tonight and used the following in my CSS:

.progressBarClass{ 
    height:20px;
    width:300px;
    margin:0 auto;
}   

.progressBarClassspan { 
    width:300px;
    position:absolute;
    text-align:center;
    font-weight:bold;
}   

And have the following in my HTML:

<script type="text/javascript">
        $(function() {
             $( ".progressBarClass" ).progressbar({
                  value: 50
             });
        });
</script>

<div class="progressBarClass"><span>50%</span></div>

Does the trick for me, although I need to come up with a better method to allow for percentages on the .ui-progressbar class instead of fixed values.

查看更多
登录 后发表回答