Problem with event delegation

Problem with event delegation

Hey,

I'm having a problem with something I asked about before on the previous jquery google group. 

This code isn't working:    

  1. <$("#sharepg").click(function(event) {
  2.         var $tgt = $(event.target);
  3.         if ($tgt.is("#expbm")) {
  4.             return false;
  5.         }
  6.         if($(this).find("#expbm").is(':hidden'))//if quick menu isn't visible
  7.             {                
  8.                 $(this).animate( //show menu on click
  9.                     {
  10.                         width: "162px"
  11.                     }, 100, function()
  12.                         {
  13.                         $(this).find("#expbm").show("slide", {direction: "down"}, 200)
  14.                         }
  15.                     );
  16.             }
  17.         else if ($(this).find("#expbm").is(':visible'))  //if quick menu is visible
  18.             {
  19.                 $(this).find("#expbm").hide("slide", {direction: "down"},200, function()
  20.                     {
  21.                         $(this).animate(
  22.                             {
  23.                                 width: "120px"
  24.                             }, 300)
  25.                     }
  26.                 ); //hide menu on click
  27.             }
  28.     });
  29. <


When I click on the layer #sharepg, it opens correctly, but the event delegation doesn't work correctly.  When I click on the #expbm layer, it first animates closed successfully, but then appears open and animates to 80% of it's original width.  Any more attempts to close it by clicking on the #sharepg layer do not work. 


I'm not sure what's going on. 

You can see what's going wrong by visiting my page.  Go to calxanime.com and sign in with the username guestperson and the password guest.  The place that it's going wrong, is the transparent bottom bar.  I've removed the event delegation on all of the buttons, except the share button.  Just test the share button.


Thanks,

Legostrat