Below code helps the developer to resize the iframe window based upon the browser window changes or to
the end user resolutions.
window.onresize = function iframeResize(){
var winW = 0, winH = 0;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' &&
document.documentElement &&
document.documentElement.offsetWidth ) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
document.getElementById('viewHome').width = winW-250 + "px";
document.getElementById('viewHome').height = winH-150 + "px";
}
window.onload = function iframeResize(){
var winW = 0, winH = 0;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' &&
document.documentElement &&
document.documentElement.offsetWidth ) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
document.getElementById('viewHome').width = winW-250 + "px";
document.getElementById('viewHome').height = winH-150 + "px";
}
the end user resolutions.
window.onresize = function iframeResize(){
var winW = 0, winH = 0;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' &&
document.documentElement &&
document.documentElement.offsetWidth ) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
document.getElementById('viewHome').width = winW-250 + "px";
document.getElementById('viewHome').height = winH-150 + "px";
}
window.onload = function iframeResize(){
var winW = 0, winH = 0;
if (document.body && document.body.offsetWidth) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' &&
document.documentElement &&
document.documentElement.offsetWidth ) {
winW = document.documentElement.offsetWidth;
winH = document.documentElement.offsetHeight;
}
if (window.innerWidth && window.innerHeight) {
winW = window.innerWidth;
winH = window.innerHeight;
}
document.getElementById('viewHome').width = winW-250 + "px";
document.getElementById('viewHome').height = winH-150 + "px";
}