【问题标题】:Automated jQuery Progress Bar自动 jQuery 进度条
【发布时间】:2011-04-01 20:10:53
【问题描述】:

今天我在网页上实现 jQuery 进度条。我需要在同一页面上实现大约 30 个进度条。

它的代码是这样的

$( "#progressbar" ).progressbar({
value: 80
});

在下面的 div 上显示 80% 的进度条

<div id="progressbar"></div>

现在发生的事情是,我必须提到 30 个不同的进度条 div,然后使用 30 个 jquery 调用调用它们来运行...

相反

我尝试的是

<div id="progressbar" title="54"></div>

调用为

$( "#progressbar" ).progressbar({
value: $(this).attr('title')
});

它应该自动为该div的标题赋予值...

虽然这不起作用...

有人知道这里出了什么问题吗?

我也试过

$( "#progressbar" ).each( function(){
progressbar({
value: 80
});
});

还是不行

谁能在这里给点小费...非常感谢!

【问题讨论】:

    标签: jquery jquery-ui progress-bar jquery-ui-progressbar


    【解决方案1】:

    发现了。干杯!

    它是这样工作的

    <div class="progressbar" rel="54"></div>
    

    然后像这样调用

                $("div.progressbar").each (function () {
                    var element = this;
                    $(element).progressbar({
                    value: parseInt($(element).attr("rel"))
                    });
                });
    

    向在这里回答的@volkan-er 干杯 - JQuery UI: multiple progress bar - problems to set dynamic values

    :)

    【讨论】:

      猜你喜欢
      • 2015-06-19
      • 1970-01-01
      • 1970-01-01
      • 2011-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-18
      • 1970-01-01
      相关资源
      最近更新 更多