HI there, quick advice please.
I am developing a photography website for a client and I want him to be able to click on an image in a list of thumbnails and that will bring up the bigger version of the image clicked on. I have achieved this in my own website here already, but I was wondering if there is a better way to do it - I don't want to use a plugin or anything like that, I want to code it myself.
On my website I had a thumbnail:
<div class="thumbnail">
<a href="javascript:void(0);" class="full_image"><img src="images/faith_thumb_1.jpg" alt="" style="border:0" onClick="change_image('big_image_1')"></a> </div><!-- END OF thumbnail 1-->
passing a big image <img src="images/faith_full_1.jpg" alt="" style="display:none" id="big_image_1">
as a parameter to the script:
function change_image(image)
{
$("#" + image).hide();
$(".box").hide();
$(".overlay").hide();
$(".overlay").show();
$(".box").show("slow");
$("#" + image).fadeIn(1000);
$(".close_button").show();
$(".close_button").click(function() {
$(this).hide();
$("#" + image).fadeOut("fast");
$(".box").hide("slow");
$(".overlay").hide("slow");
});
}
which then did all the rest (and I got quite a bit of help with this, thanks again!!).
Now I wonder, is there a better, more efficient and easier way to do this or is it better if I stick to that in my other website? I just thought I will ask before starting to code - I have only coded the overlay so far
thanks