views:

95

answers:

1

Hello,

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!

+2  A: 

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});
SLaks
Yeah... But they will be generated by php based on an undefined number of rows in a db...
mike
So? You can still do it.
SLaks