开发者

Is there a way to show the percentage number inside the jQuery UI Progressbar?

Does jQuery UI support showing the number inside the开发者_如何学运维 Progressbar, like this:

Is there a way to show the percentage number inside the jQuery UI Progressbar?


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.


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜