i got the following jQuery stuff where i entered the array numbers and selector positions by feet – can i do this in one block with an for loop?
jQuery(document).ready(function(){
jQuery('.hoverB0x:eq(0)').html('<a style="background:white;" class="imageLink" href="${createLink(uri: "/beirat/")}">Profil von' + names[0]+'</a>');
jQuery('div.name:eq(0)').html(title[0]+' '+names[0]);
jQuery('div.description:eq(0)').html(funktion[0]);
jQuery('a.imageLink:eq(0)').prop('href', 'beirat/'+ident[0]);
jQuery('a.contentLink:eq(0)').prop('href', 'beirat/'+ident[0]);
jQuery('.profilBildInner:eq(0) img').attr('src', base+ident[0]+'.png');
Now about 10 blocks going to follow up with eq([arrayPos]) and names/ident[arrayPos]
I dont see why not… just change the indexes to use the increment counter of a
forloop. You dont show how you get thenames,ident, orfunktionarrays but presumable they are the same size and hold the proper count of things you expect in the document so use one of those to get your base increment range.Further more if possible it would make much more sense to combine those arrays into a a single array of hahses like:
Then you can do: