多个 jQuery UI 进度条

发布于 2024-08-15 01:11:29 字数 234 浏览 0 评论 0 原文

我试图在一个页面上显示多个“静态”jQuery 进度条,所有进度条都具有不同的不同值......无论如何,假设我有这段代码:

$(function() {
$(".progressbar").progressbar({value: 37});
})

有没有办法对多个“使用同一个类”进度条的实例”?是否可以传递不同的值?

任何帮助将不胜感激...

谢谢!

I'm trying to display multiple, "static" jQuery Progress Bars on a single page, all with different different values.... Anyhow, say I have this bit of code:

$(function() {
$(".progressbar").progressbar({value: 37});
})

Is there a way to use the same class for multiple "instances" of the progress bar? And is it possible to pass different values?

Any help would be appreciated...

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好菇凉咱不稀罕他 2024-08-22 01:11:29

如果您有多个具有 progressbar 类的元素,则 $('.progressbar').progressbar() 行应该使所有元素成为单独的进度条。

如果为每个进度条元素指定不同的 ID,则可以单独操作它们。

例如:

$('#bar1').progressbar({value: 37});
$('#bar2').progressbar({value: 54});
$('#bar3').progressbar({value: 99});

If you have multuiple elements which have a class of progressbar, the line $('.progressbar').progressbar() should make all of them into separate progress bars.

If you give each progressbar element a different ID, you can manipulate them individually.

For example:

$('#bar1').progressbar({value: 37});
$('#bar2').progressbar({value: 54});
$('#bar3').progressbar({value: 99});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文