I am trying to create an array images to preload by getting each of the image link in the rel attributes.
I have on a page:
<div id="gallery_thumbs">
<a><img src="images/image-1-thumb.jpg" rel="images/image-1.jpg" /></a>
<a><img src="images/image-2-thumb.jpg" rel="images/image-2.jpg" /></a>
<a><img src="images/image-3-thumb.jpg" rel="images/image-3.jpg" /></a>
<a><img src="images/image-4-thumb.jpg" rel="images/image-4.jpg" /></a>
</div>
When the page loads I need to get all the rel attributes in the #gallery_thumbs a img and append these to an array like so:
preload([ 'images/image-1.jpg', 'images/image-2.jpg', 'images/image-3.jpg', 'images/image-4.jpg']);
Can anyone help?
101010button up top, it'll space it over 4 spaces...and markdown will format it nicely for you. Click edit above to see how the formatting looks after I tweaked it :)