This is somewhat related to jquery but is primarily a .js issue.
I am converting an existing PHP photo album. I have the image load working but can't see how to get the respective caption key from the js to pull from $caption_array.
This is the code I am using - where the div class=change is actually a string of thumbnails each with the ID set as the filename. Click one and the div class=bg-wrapper is loaded with the main image.
Code:
<div class=change>thumb(s)</div>
<script>
$(function() {
$('<img>').attr({'src':'<?php echo $image; ?>','id':'bg','title':''}).appendTo('#bg-wrapper').parent().fadeIn(1000);
$('.change').click(function(e) {
e.preventDefault();
var image = '<?php echo $album; ?>/'+$(this).attr("id").replace("tn_","");
$('#bg').parent().fadeOut(800, function() {
$('#bg').attr('src', ''+image);
$(this).fadeIn(800); }); }); });
</script>
<div class=bg-wrapper></div>
I hope this is clear.
thanks