How to create a thumbnail to display a larger version image and visa versa?

I want to create a thumbnail that uses a link to display a larger version of the image and than a link to display the thumbnail again. I can create the thumbnail to display the larger image, but not visa versa. How do I go about doing that?
Barbara69Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Julian HansenConnect With a Mentor Commented:
Why not just use a lightbox library - which does exactly that?
0
 
Barbara69Author Commented:
I checked out lightbox, but it doesn't toggle the images. I want to be able to toggle between the thumbnail image and the larger image.
0
 
BillDLCommented:
Lightbox creates an "overlay" on top of the page into which the image is loaded.  If it is loaded full screen you can set the transparency so that it either completely obscures the page below or allows you still to see some of it, and there should be an "X" somewhere in the white frame around the image to close the overlay and revert back to the page with the thumbnail.  You can also configure it to just load the overlay at a nominated size on top of the page, with the "X" button to close it and revert to the page.  Some stylings of this effect don't have the intuitive "X" and rely on you discovering that if you click the image anywhere it closes the overlay.

You could configure a lightbox "slideshow" containing only two images, the thumbnail and the main image, and the back and forward arrows could be used to "toggle" the views.

Isn't your thumbnail image part of a page that contains other content?

If the main image was loaded in the same page using a standard hyperlink on the thumbnail, the browser's back and forward buttons would "toggle" between the page with the thumbnail and the main image on its own.

There are some fancy CSS effects that allow you to mouseover areas on a page and it shows a popover effect.  Maybe that's what you're looking for?

Simply toggling between a thumbnail and large image doesn't really make any sense to me.  Could you explain a little more about your actual objective so we can perhaps advise the most appropriate method to suit your needs.
0
 
Julian HansenCommented:
Can you post what you have done already - I am not sure I understand the difference between what you want to do and what a lightbox does?
0
 
BillDLCommented:
Hi Barbara
I'm curious to know what changed.  You said that LightBox didn't do what you wanted, but you selected the suggestion as your solution.  It's always helpful for us to get some feedback.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.