Jump to content

Image Gallery


pogester

Recommended Posts

Hi I am looking for some help, I have set up a new website for my son and want to include a gallery however the gallery I want to have it so that there are a collection of thumbnails and when you hover over a thumbnail a large version of the image appears on the left of the screen.

 

To explain the thumbnails would appear where the blue box is at the right and the large image would appear where the picture is at present.

 

Can anyone recommend the best way to do this as I know I can do it in Flash but dont really want to use Flash if I can do it in PHP

 

The site at present is www.mitchellpatterson.co.uk/new

 

Thanks in advance

 

Darren

Link to comment
Share on other sites

create a DIV for the large image to appear in..near the blue box

give it an ID like preview


then create a function in javascript to do the image changing

function swapImage(imageURL) {
     document.getElementByID("preview").style.backgroundImage = "url(\"" + imageURL + "\")";
}

 

then for each of your thumbnail.....whatever tag you have them in

give them an onMouseOver action


Link to comment
Share on other sites

Hi thanks for your help but am having a little trouble.

 

I have declared a javascript function in <head> as follows

 

<script language="text/javascript">

function swapImage(imageURL) {

document.getElementByID("mitch_pic").style.backgroundImage = "url(\"" + imageURL + "\")";

}

</script>

 

Then in my <body> where I want the content I have

 

<p><img src="gallery/rhtriker_thumb.gif" onmouseover="swapImage('rhtriker.gif')" /></p>

 

set for the thumbnail image, however when I hover the mouse over the image nothing happens and the cursor doesnt change, any help appreciated, sorry I know this isnt PHP but didnt want to start a whole new topic.

Link to comment
Share on other sites

It's tough to say without seeing the page in it's entirety. I would suggest placing an alert('here') in the swapImages function just to see if the code is even reaching the function.

 

 

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.