var lBannersbanners = new Array(); lBannersbanners.push(new Array('http://google.nl','http://wildnikki09.files.wordpress.com/2009/01/fish-with-hands1.jpg')); lBannersbanners.push(new Array('http://nu.nl','http://www.photoshoppix.com/modules/coppermine/albums/userpics/10002/army_fish.jpg')); lBannersbanners.push(new Array('http://google.nl','http://img.photobucket.com/albums/v212/kellyvogel/Dieren/vis1.jpg')); lBannersbanners.push(new Array('http://nu.nl','http://news.nationalgeographic.com/news/2005/10/images/051007_robot_fish.jpg')); lBannersbanners.push(new Array('http://google.nl','http://dieet.blog.nl/files/2009/08/prinses-vis1-300x299.jpg')); lBannersbanners.push(new Array('http://nu.nl','http://news.nationalgeographic.com/news/2005/10/images/051007_robot_fish.jpg')); jQuery(document).ready(function() { var lAmountBannersbanners = lBannersbanners.length; var lAmountOfPlaceHoldersbanners = jQuery('.banners').length; var lAmountPerBannerbanners = Math.round(lAmountBannersbanners / lAmountOfPlaceHoldersbanners); var lCurrentBannerPosbanners = 0; jQuery('.banners').each(function() { for (var ibanners = lCurrentBannerPosbanners; ibanners < (lCurrentBannerPosbanners + lAmountPerBannerbanners); ibanners++) { jQuery(this).append(''); } lCurrentBannerPosbanners = ibanners; }); });