title: the each function
body: <p>hii  I have a 680 buttons in a page, and I want to run a function on them all with the each function.  here is the code:</p>
  
  <pre><code>$("button#check_all").button().click(function(){
      btns=$(".viewport").find('.third_cat_chb');//here are all 680 btns
      this_btn=$(this);
      count=btns.size(); //680
      cpt=0;
      btns.each(function(){
          cpt += 100/count;
          if($(this).is(".cat_chb_off")){
              $(this).trigger('click');
          }
          $("#progressbar").progressbar({ value : cpt});
      });
      $("#progressbar").hide('slow');
  });
  </code></pre>
  
  <p>The problem is that I want to see the buttons changed immediately when I click to select them all, not to set interval but to finish each button alone and online.
  but what really happens is that the site is stuck over 35 seconds and I see the buttons changed suddenly.</p>