suess0r Posted June 11, 2007 Share Posted June 11, 2007 Hello, I'm trying to design a basic Gallery - So when someone clicks on a thumbnail of the image (on the right column) I want the Big image on the body to be the larger image of that image. Here's my page so you can get a visual of what I mean.. http://www.classiccustomflooring.com/gallery.html I'm not that big in JS so this might sound pretty n00bish ;x thanks for any help you can provide! Let me know if u need any more info thank you.. Link to comment https://forums.phpfreaks.com/topic/55157-building-a-very-basic-gallery/ Share on other sites More sharing options...
Goose Posted June 12, 2007 Share Posted June 12, 2007 Alright, basically you have a link that calls some javascript code ... its pretty simple. Here is your link code: <a href="changeImg('big/img/path.gif');"><img src="small/img/path.gif" alt="small img" border="0" /></a> Here is your big image code: <img src="default/big/img/path.gif" alt="big image" id="bigImg" /> And finally this is your JS code (put this in the <head> of your document): function changeImg(path){ document.getElementById('bigImg').src = path; } Link to comment https://forums.phpfreaks.com/topic/55157-building-a-very-basic-gallery/#findComment-272818 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.