$('.myElem').live('click', function() {
$(this).hide(500, function() {
$(this).siblings('.myOtherElem').show();
});
});
The above doesn’t work because $(this) is no longer in correct scope in the callback. How do I pass my original source element into the callback?
Actually your code should work.
To access
thiswithin an inner javascript method you might store the reference in the outer method scope:However in most jQuery methods
thisis referring to the selector or element used: