Jump to content

Building a very basic Gallery!?


suess0r

Recommended Posts

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

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;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.