title: jQuery + Multiple Checkboxes: Show div on checked, Hide on uncheck
body: <p>I got multiple checkboxes generated from a PHP script.</p>
  
  <pre><code>&lt;input type="checkbox" class="checkbox" name="item[]" value="1" /&gt;
  
  &lt;input type="checkbox" class="checkbox" name="item[]" value="2" /&gt;
  
  &lt;input type="checkbox" class="checkbox" name="item[]" value="3" /&gt;
  
  &lt;input type="checkbox" class="checkbox" name="item[]" value="4" /&gt;
  </code></pre>
  
  <p>Now, once a checkbox gets checked - I want to show a div with options like "Delete Selected". But, after all checkboxes are unchecked, the DIV should disappear again.
  I have got the following code, but it does not hide the DIV.</p>
  
  <pre><code>    $(".checkbox").live('click', function () {
  
          countChecked () ;
  
          if (countChecked() == "1" ) {
  
              $("div#options").fadeOut("medium") ;
  
          } else {
  
              if ( $("div#options").is(":hidden") ) {
  
                  $("div#options").fadeIn ( "medium" ) ;
  
              }
  
          }
  
      });
  </code></pre>
  
  <p>Also, the "countChecked"-function is shown below.</p>
  
  <pre><code>    function countChecked() {
  
          var n = $("input.checkbox:checked").length;
  
      }
  </code></pre>