I have some JQuery Code as follows:
$("#sh-zone-button-cart-menu").live("click", function(event)
{
event.preventDefault();
$("#sh-zone-cart-menu").toggle(0, function(){
if($(this).is(":visible")){
$(this).siblings(".sh-zone-button-link-menu-content").hide();
$("#sh-zone-button-cart-menu").parent().removeClass("current");
//need to reference (this) for $("#sh-zone-button-cart-menu") here
}
});
$("#sh-zone-button-cart-menu").parent().toggleClass("current");
});
I am trying to access the this reference for my initial click from within another sub-element i.e. I would like to get the this reference that would have been available just after the first curly brace of my live() method. However, I need access to it from within another sub-element i.e. inside my toggle() method.
How can I do this?
Thanks.