Click link to change image

He has: 49 posts

Joined: Jul 2007

Hi all,

I'm building a site for one of my clients and can't seem to come up with a solution to this problem-

I'm wanting the photograph within a web page to change when visitors click on the title of the photograph they want to see. These titles will be in an unordered list.

In other words, if there was a list of names on the left and a photograph on the right, when someone clicks on a different name then the photograph changes, relevant to the name.

If you get what I mean!!!

Thanks in advance for any help given,


robfenn's picture

He has: 471 posts

Joined: Jun 2005

This uses a dropdown but the code is basic, you could strip the form out.

Alternatively i used a back and next thing on our website for the little screenshots:

He has: 49 posts

Joined: Jul 2007

Thanks for the links robfen,

I'm afraid I've never had to use Java before now, and I'm not sure on how I'd convert the code (in the first link you supplied) from a table layout to css, div etc. Could I still use an unordered list rather than a drop-down menu?

Thanks again robfen,


calculator's picture

They have: 40 posts

Joined: Nov 2007


turn your image titles into links and use javascript for it.

Here is an example using onmouseover()

Simply replace onmouseover by onclick in the above tutorial.

Otherwise post your page code here and we'll try and help you out more.

hope this helps.

He has: 49 posts

Joined: Jul 2007

Thanks to all who replied to my problem.

I found a solution to my problem, it was an inline image viewer that I required after all. It just needs a little tinkering with css to place it on my page.

Heres the link incase anyone else has the same problem -

Thanks again,


They have: 1 posts

Joined: May 2012

Thanks for the link graisbeck , was searching for that code .
Anyone know how to add a fade effect to that .

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.