Needs review
Project:
Image Caption
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 May 2010 at 13:27 UTC
Updated:
19 May 2010 at 13:27 UTC
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
| Comment | File | Size | Author |
|---|---|---|---|
| image_caption-jquery.patch | 1.14 KB | seutje |