Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Need help with Zoom script...
08-27-2007, 02:52 PM #1
- Join Date
- Aug 2007
- Thanked 0 Times in 0 Posts
Need help with Zoom script...
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.
// 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++)