I have a series of thumbs which I want a click on one to activate the appearance of the corresponding image. Without writing a script for each thumbnail-image pair I'm looking for a way for an image with id="thumb1" to trigger the appearance of and image with id="photo1" and so on.
I found this answer and tried to implement it thus:
$(function(){
$('img[id^="thumb"]').click(function () {
$('img[id^="photo"]').show();
});
});
However, all the thumbs labelled "thumb1", "thumb2" etc all trigger the photo labelled "photo4" (the last in the series).
Any suggestions? Much thanks.