PDA

View Full Version : iFrames



MasterAries7
22 Jun 2006, 10:22 AM
Can they be resized dynamically with JS?

If so, why wont this script work, i keep getting the warning that document.viewing has no properties.



// JavaScript Document

// resizeHeaderImages makes calls to the sizeTo() function

function resizeHeaderImages(){
if(navigator.userAgent.indexOf('MSIE') != -1){
var width = document.body.clientWidth / 4;
var percentage = width/640;
var height = 480 * percentage;
document.image1.width = width;
document.image1.height = height;
document.image2.width = width;
document.image2.height = height;
document.image3.width = width;
document.image3.height = height;
document.image4.width = width;
document.image4.height = height;
document.viewing.width = width*4;
document.viewing.height = document.body.clientHeight - height-30;
}
}