有没有办法在jQuery UI进度栏中显示百分比数字? [英] Is there a way to show the percentage number inside the jQuery UI Progressbar?

查看:152
本文介绍了有没有办法在jQuery UI进度栏中显示百分比数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery UI支持在进度栏中显示数字吗?

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

推荐答案

不要拖累旧线程,但是我今晚早些时候尝试过,并在CSS中使用了以下内容:

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;
}   

在我的HTML中包含以下内容:

And have the following in my HTML:

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

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

对我来说有用,尽管我需要想出一种更好的方法来允许在.ui-progressbar类上使用百分比而不是固定值.

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.

这篇关于有没有办法在jQuery UI进度栏中显示百分比数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆