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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.