July 8, 2008
An Unobtrusive Image Viewer using jQuery
Continuing from my last presentation on jQuery basics, I thought I would take what I have covered so far and create a little useful example.
This jQuery Image Viewer can be considered and updated to the DOM Image Gallery I discussed last season from Jeremy Keith's DOM Scripting book.
jQuery methods are used to display the hovering image labels shown underneath each thumbnail as well as display the full-size image. A background grey layer is also displayed to "disable" the other thumbnails until a "close" button is clicked. This image viewer is a little more stylish and more in tune to what you see today in other examples on the web.
And if JavaScript is disabled or not available in the browser, the image(s) will still be displayed (on a new page), so the script still retains its core functionality and stays "unobtrusive", which really is important.
