title: jquery toggle triggers twice on child element?
body: <p>I have a div (id="menu") on my page with onclick="toggledropdown()". This div has child img elements as well as text. The toggle code works just fine when anything but the images is clicked. However, when the images are clicked, the div slides down and then back up again.</p>
  
  <p>toggle code:</p>
  
  <pre><code>function toggledropdown()
  {
      if ($("#dropdown").is(":hidden"))
      {   
          $("#dropdown").slideDown(400);      
      }
      else
      {
          $("#dropdown").slideUp(50);     
      }
  }
  </code></pre>
  
  <p>body.click to hide drop down if the page is clicked:</p>
  
  <pre><code>$(document.body).click(function(event)
  {
      var targetID = $(event.target).attr("id");
      if (targetID !== "dropdown" &amp;&amp; targetID !== "menu")
      {
          if (!$("#dropdown").is(":hidden"))
              toggledropdown();
      }
  });
  </code></pre>
  
  <p>drop down.click to negate the body.click</p>
  
  <pre><code>$("#dropdown").click(function(e)
  {
      e.stopPropagation();
  });
  </code></pre>
  
  <p>The html div (some things unrelated to problem omitted):</p>
  
  <pre><code>&lt;div class="menu" id="menu" onclick="toggledropdown();"&gt;
      &lt;img id="dropdownthumbnail" (blahsrc/styleblah) /&gt;
      Text
      &lt;img id="dropdownarrow" (blahsrc/styleblah) /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So, to reiterate, clicking on the menu div (minus the images) slides out the menu correctly, clicking on it again (including the images) or anywhere else on the page works correctly, but clicking on the images while the drop down is hidden toggles it twice (you can see it slide out and back in again).</p>
  
  <p>Are the child imgs triggering the parent's onclick twice? Once for the child, once for the parent? Why? How do I make it work as expected: clicking anywhere on the div triggers the onclick once?</p>