Question

I am creating a webpage in html with php.

I want the user to be able to click on a small icon image. When the icon is clicked a preview of a larger image appears.

Guessing the solution probably involves javascript or flash. Can you point me to the right direction. Thanks in advance.

Was it helpful?

Solution

It sounds like you want a Lightbox?

A Lightbox allows you to have thumbnails of images on your page and when a user clicks on them, the larger image will popup in the middle of the screen. It's very common.

If what you are really looking for is a show/hide effect, you could use JavaScript to show the larger image if the user clicks on the smaller image. A JavaScript library like jQuery or YUI will make it very easy.

OTHER TIPS

If you're doing it in php, then may as well use GD to do it for you.

Here's an excellent article to get you started: http://icant.co.uk/articles/phpthumbnails/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow