steveb533
12-30-2010, 08:01 PM
Hi
I am trying to make a thumbnail image gallery using PHP to pull in the pictures from an album. I'm using jquery to display the main image when the thumb is clicked. I would like to display the first main image, from the selected album, as the default when the page is opened. Seems like it should be doable but I can't figure it out. here is the php:
echo
"<a href='#' rel='$base/$get_album/$file' class='image'><img src='$base/$thumbs/$file' border='0' class ='thumb'></a>";
Here is the jquery:
$(function() {
$(".image").click(function() {
var image = $(this).attr("rel");
var title = $(this).attr("alt");
var description = $(this).attr("content");
$('#gallery').hide();
$('#gallery').fadeIn('slow');
$('#image').html('<img src="' + image + '"/>');
return false;
});
});
can I just add something before the function? Thanks in advance.
Steve
I am trying to make a thumbnail image gallery using PHP to pull in the pictures from an album. I'm using jquery to display the main image when the thumb is clicked. I would like to display the first main image, from the selected album, as the default when the page is opened. Seems like it should be doable but I can't figure it out. here is the php:
echo
"<a href='#' rel='$base/$get_album/$file' class='image'><img src='$base/$thumbs/$file' border='0' class ='thumb'></a>";
Here is the jquery:
$(function() {
$(".image").click(function() {
var image = $(this).attr("rel");
var title = $(this).attr("alt");
var description = $(this).attr("content");
$('#gallery').hide();
$('#gallery').fadeIn('slow');
$('#image').html('<img src="' + image + '"/>');
return false;
});
});
can I just add something before the function? Thanks in advance.
Steve