I've been using the auto-resizing images version (1.2) mod for some time now, but I recently decided to do it differently.
Now the mod has 2 options ; - resize the image to a 'static' maximum width defined as FixedWidth in resizeimgs.js.
- Resize the image to a portion of the screen width (also defined in resizeimgs.js)
I've ditched option 2, and created a new option ; resizing the image to the available window size minus a fixed margin.
So, not the client resolution is key, but the actual size of the browserwindow.
What did I do : I altered resizeimgs.js.
I added this to the functions resizeImage(thisimage) and enlargeimg(thisimage).
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
} else if( document.documentElement &&
( document.documentElement.clientWidth ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
} else if( document.body && ( document.body.clientWidth ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
}
Now we've retrieved the actual window size of the browser in the variable myWidth.
We take the already existing value for FixedWidth but instead of using it as the maximum width, we use it as the required margin.
Parsing the actual code here doesn't work, but you can download the current file from oxle here (login demo/demo)
Perhaps someone finds this mod of a mod usefull.
Oh, perhaps someone wants a demo: