How to display multiples jQueryUI progressbars in a page in Drupal 7? I am developping my personnal website with Drupal 7. I would like to show a progressbar for each of my skills, but with differents values.

For exemple, I would like to see a progressbar under (or between if possible) a text, and (also if possible) with a percentage.

So I tried to use jQuery UI to solve my problem.

I want all my progressbars with a different value for each. Below, an exemple of the code of my website :

&lt;?php
drupal_add_library('system', 'ui.accordion');
drupal_add_library('system', 'ui.progressbar');
drupal_add_js('jQuery(document).ready(function(){jQuery("#accordion").accordion();});', 'inline');
drupal_add_js('jQuery(document).ready(function() {jQuery(".progressbar").progressbar({ value: 37 });', 'inline');
?&gt;

&lt;div id="accordion"&gt;
&lt;h3&gt;&lt;a href="#"&gt;RÉSEAU&lt;/a&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;p&gt;&lt;h4&gt;Windows Server 2008&lt;/h4&gt;
&lt;div class="progressbar" rel="50"&gt;50%&lt;/div&gt;

&lt;h4&gt;Ubuntu Server&lt;/h4&gt;
&lt;div class="progressbar" rel="50"&gt;50%&lt;/div&gt;

&lt;h4&gt;Virtualbox&lt;/h4&gt;
&lt;div class="progressbar" rel="90"&gt;90%&lt;/div&gt;
&lt;/p&gt;
&lt;/div&gt;


But it does not work.

To solve that problem, I tried that kind of code found on that website, but I does not work for me, when I include it in drupal like that :

&lt;?php
drupal_add_js('jQuery("div.progressbar").each (function () {var element = this;jQuery(element).progressbar({value: parseInt(jQuery(element).attr("rel"))});});', 'inline');
?&gt;

&lt;div class="progressbar" rel="90"&gt;&lt;/div&gt;


Perhaps, I am in wrong, but any answer would be so great. Thank you in advance. :)
Your first code example for the progress bar has a small syntax error (missing a }); at the end of the line). I'm not sure exactly why your second example doesn't work, (I didn't try it) but this code works perfectly for me using your HTML as an example:

drupal_add_js("
  (function($) {
    $(function() {
      $('.progressbar').each(function() { 
        var val = $(this).attr('rel');
        $(this).progressbar({ value: parseInt(val) });
      });
    });
  })(jQuery);",
  'inline'
);


This code produces:



EDIT

I've just noticed you have some invalid HTML in your code which probably won't help. You're wrapping &lt;h4&gt; and &lt;div&gt; tags in a &lt;p&gt; tag, which is invalid XHTML. It might not be the problem but it would be better practice to change that &lt;p&gt; to a &lt;div&gt;.