sparkygoblue
Joined 15 years ago
Joined 15 years ago
var $image = $('#my-div img');
This way jQuery doesn't have to traverse the DOM more than once to select the element.
Also, I believe you can do all of your mousedown() event code in one block.
Edit: oops, upon further inspection, I see you are doing this all in the console. Caching the selector is still possible, but now I understand why you did the mousedown() event the way you did.
The types of skills taught in computer programming courses -- abstraction, high-level problem solving, complex logic -- are ones I believe all students should have some level of proficiency in by the time they leave high school.
Either way, this looks good, and I'll keep it in mind for future projects.
By the way, bugmuncher looks cool. Congrats!
[email protected]