I am using jquery json to return images from flickr. If I want to append all the image to one div thats not a problem. What i want to do is return 36 images but append 1-9 images to div one and 10-18 to div two 19-27 to div three and 28-36 to div four.
Share
This should do it:
Example: http://jsfiddle.net/9KyaK/
Assumes
$imagesis the collection of images, and each div has an id ofdiv0', 'div1etc.EDIT: I had
.appendTo('#div' + i );instead of.appendTo('#div' + (i / 9) );. Fixed and added an example.EDIT: For your specific code, add this to the end of the
getJSONcallback. After theforloop.