Dynamic thumbnails and preview images with DOM, CSS and PHP
Image previews with DOM JavaScript (and PHP if wanted)
Get and talk about it
Download version 1.1
Comment on the blog
What it does:
If your browser supports the W3C DOM, you can see small camera icons next to each of
the links in the following list. Activate these either via mouse or keyboard to
see a preview of the linked image:
Foot section of bed
Head section of bed
Leather sofa
Activating either the camera icon link once more or the thumbnail will make it
vanish.
Changes:
Bugfix: I just realised that the script failed to work properly without PHP :(. This is fixed now in version 1.1
Update: Faruk Ates of KuraFire fame asked on the blog if there is an option to only allow one image to be shown. It is, and I made a special build of the script that does exactly that.
The task
Sometimes we want to offer a visitor a preview of what is lurking behind a
link, especially when it is a huge picture and there might not be a need to
load it. This is where thumbnails come in handy, and it is pretty easy to use CSS to
show and hide a thumbnail in modern browsers:
Mouse over the following link to see the thumbnail: Black leather sofa
HTML:
<p ...
All rights reserved.