I have the code below and I want to programmatically reproduce it with jQuery so that it can handle a variable number of photos from Flickr. I want to use jQuery.wrap() to wrap each tag in a link back to the original image on Flickr using method chaining. I want to set a unique ID attribute on each image. Its value is to be based on a loop counter in the for-each block ( using “
attr() ”).
Then I want to refactor the code to pop open a lightbox style dialog when clicked, i.e. reuse the wrap() method to create both blocks of HTML (the links and the popups).