I would like to improve the loading speed of the Shadowbox popup images on this page
Basically, all images opened by Shadowbox are linked to from this page:
<a href="images/illustration/garden1.jpg" class="garden"></a>
<a href="images/illustration/garden2.jpg" class="garden"></a>
etc etc.
I know how to preload images by listing them like this:
var images = [ 'image1.jpg', 'image2.jpg', ]
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}
$(document).ready(function(){
$(images).preload();
});
Is there a way to pull all the href
values into the preload array? If so, how might I exclude links to other documents? Or am I going about this all wrong?!
Thanks.