View Single Post
Old 10-10-2012, 04:42 AM   PM User | #8
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,461
Thanks: 52
Thanked 457 Times in 455 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
or you could use the script to load the thumbnail images in at the same time...

Code:
<body>
<img id="bg"/>
<div class="change"></div>
<div class="change"></div>

<script>
var data=["img_cat.jpg|cat caption here","pic_dog.jpg|about the dog"];
var pics=[];
$(document).ready(function() {
$.each(data, function(index, value) { 
$('.change').eq(index).html('<img src="tn_'+value.split("|")[0]+'"/><br>'+value.split("|")[1]).click(function(){
$('#bg').parent().fadeOut(800, function() {
            $('#bg').attr('src', value.split("|")[0]); 
              $(this).fadeIn(800); });
				});
		});
});
</script>
</body>
xelawho is offline   Reply With Quote