I’ve written a small jQuery plugin for image resizing in quite a specific situation.
On art-focused (or at least image-oriented) websites it’s often necessary for an image be visible in its entirety to be properly appreciated. In cases where an image is rated, or bought based to it’s quality, a visitor may want to see the whole image, without scrolling, without the interuption of a lightbox or modal, yet with the option to view it larger. As websites are often fluid-width and browser dimensions are up to the user, it can be tricky to ensure this image display.
I was inspired by the behaviour of the artwork display on Artsy.net and this plugin is intended to fulfil a similar role.
The plugin helps by reducing the image to fit within the window and gives the user a toggle with which to switch between the “fit” size and the actual size image.
You can see an example of it in action here: http://jsfiddle.net/davecranwell/M5q7C/
Download the plugin from Github and read more information about options and use.