Discussion on:

Message 2 of 2
0 Votes
+ -
I'm no expert but...
I'm no jQuery expert but perhaps it would have been a bit more efficient to set up everything, or most of it, in the markup and then just use jQuery to .show() and .hide() or even animate(). Once you append() and remove() and then append() again, it's "wasteful", yes?

Also, is there a reason you elected to use a link instead using a data element within the img? Hover or even .click for that matter will work on images just as easily as links, correct?

Don't get me wrong, I understand there's more than one way to skin the jQuery cat. That said, as someone who is trying to learn the library, I often lose sleep wondering, "Yes, it works. But did I do it as thoroughly as possible?" Working examples are easy to find but optimized ones not so much so. Perhaps this is something you can visit in future tuts? Thanks.
Posted by Mark Simchock
5th Jun