dupalo - 2:42 pm on Sep 5, 2012 (gmt 0)
Fotiman, tanks for getting back to me. Yes I think there might be few typos here and there - sorry - like the errors you picked up, I think I might have missed something while I was copying and pasting. The code is correct in the original script though. Also, about the id myImages, I apologize, it's a class and not an id, thanks for pointing that out, again I must have changed it while pasting in here.
You're right when you say that eventually I append it to the document, but only when createDom is true.
Unfortunately I can't do all this before the loop: I mean, I could certainly find .myImages before the loop but the values of the data attributes are set within the loop so if I want to change them I will have to do it within the loop. The reason for that is because of the json data: in order to get to the images and to other string values I need to get out of it, I have to "dig" deep, hence the several loops (in the script I actually have 3 nested loops, I haven't included the 3rd here because it is not needed for the images). That's why I was hoping to find a clever selector that could target the current image inside the loop.