ich ein Array mit Bild-Links gefüllt haben, und ich möchte ein Skript schreiben, das wäre, mit Hilfe von Javascript (mit jQuery-Bibliothek), würde die HTML-Ausgabe wie formatiert so:jQuery bauen Galerie von Array
<div id="gallery">
<div class="scrollable">
<div class="items">
<div>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
</div>
</div>
</div>
</div>
Nach jeweils 5 Bildverknüpfungen, die es verarbeitet, wird ein weiterer div-Container in der items-Klasse hinzugefügt. Also, wenn das Array 15 Bild-Links enthält dann das Endergebnis wäre so etwas wie:
<div id="gallery">
<div class="scrollable">
<div class="items">
<div>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
</div>
<div>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
</div>
<div>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
<img src="URL_from_array"/>
</div>
</div>
</div>
</div>
und so weiter bis zum Ende des Arrays. Irgendwelche Ideen?
Edit: Sorry über die Code-ID, es vermasselt beim Posten.
Edit2: Erläuterung.
Ist es nicht möglich, diese Server-Seite zu tun, anstatt * nach * die Seite geladen wurde? –
Ja, es ist möglich, aber ich möchte diese Client-Seite aus verschiedenen Gründen machen. –