repeating selectors is usually not such a good idea, even if you're passing in an element
so instead of repeating $(this) a couple times, you should just cache it once like var $this = $(this) and then just using $this

also

$(this).parent().foo().bar()

is more performant than

$(this).parent().foo();
$(this).parent().bar();

coz ur only doing the traversing once (assuming both the foo() and the bar() method are methods that return the original set of matched elements)

I also changed the outer double quotes to single quotes so the inner double quotes no longer need to be escaped

might come back to put this in a proper Drupal.behavior

CommentFileSizeAuthor
image_caption-jquery.patch1.14 KBseutje