problems with selectors with jquery
<p>Sorry guys, I am trying to add an event to a image inside of a table, so when its clicked it collapse the div under need.</p>

<p>I am facing several problems here.</p>

<ol>
<li>all tables and div use the same class.</li>
<li>it may be a minimum of two tables and divs. </li>
<li>first table should no be click able, only its images (for show and hide div under) </li>
<li>rest of tables should be click able the whole table to show and hide div under with slidetoggle. </li>
<li>rest of tables also have two images for show with slideDown and slideUp.</li>
</ol>

<p>What I have it works but not fully.</p>

<p>Once again.</p>

<p>Thanks.</p>

<p>so far this is what I have.</p>

<pre><code>&lt;script type="text/javascript"&gt;
 $(document).ready(function(){

   $(".heading:not(#Container1)").click(function(){
     var c = $(this).next(".container");
     c.slideToggle("slow");
   });


 });

 $(document).ready(function(){
   $("img[alt='min']").click(function(){
     var c = $(this).next(".container");
     c.slideUp("slow");
   });

   $("img[alt='max']").click(function(){
     var c = $(this).next(".container");
     c.slideDown("slow");

   });
 });
&lt;/script&gt;

&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
    &lt;table class="heading" id="container1"&gt;
      &lt;tr&gt;
        &lt;td&gt;heading1&lt;/td&gt;
        &lt;td&gt;&lt;img alt='min'/&gt;&lt;img alt='max'/&gt;&lt;/td&gt;
     &lt;/tr&gt;
   &lt;/table&gt;
   &lt;div class='container'&gt;Container1&lt;/div&gt;
   &lt;table class="heading"&gt;
     &lt;tr&gt;
       &lt;td&gt;heading2&lt;/td&gt;
       &lt;td&gt;&lt;img alt='min'/&gt;&lt;img alt='max'/&gt;&lt;/td&gt;
      &lt;/tr&gt;
   &lt;/table&gt;
   &lt;div class='container'&gt;Container2&lt;/div&gt;
   &lt;table class="heading"&gt;
     &lt;tr&gt;
       &lt;td&gt;heading3&lt;/td&gt;
       &lt;td&gt;&lt;img alt='min'/&gt;&lt;img alt='max'/&gt;&lt;/td&gt;
     &lt;/tr&gt;
   &lt;/table&gt;
   &lt;div class='container'&gt;Container3&lt;/div&gt;
 &lt;/body&gt;
&lt;/html&gt;
</code></pre>
