View Full Version : Need help with Zoom script...

08-27-2007, 02:52 PM
I have assembled the following script from examples around the Web. It's intent is to resize page contents based on the size of the browser window. So far, I have it working very well for images, but I'm having trouble getting the text to resize. If anyone can offer suggestions, I would appreciate it.

FYI: this only works in IE -- and that's ok with me.

<script type="text/javascript">

function resize()

// get window height: subtract 80 to account for the no scaling elements on the page
if (window.innerHeight) nH = window.innerHeight-80;
else nH = document.getElementById("bodyNode").offsetHeight-80;

// get window width
if (window.innerWidth) nW = window.innerWidth;
else nW = document.getElementById("bodyNode").offsetWidth;

mod = (nW < nH) ? nW : nH;
mod = nW;

// this controls the level of the scale
multi = 60;

mod = Math.round(mod/multi);
mod = mod*multi;

imgs = document.getElementsByTagName("img");

for (var x = 0; x < imgs.length; x++)