PDA

View Full Version : Iframe resize



seamas
10 Apr 2012, 12:09 AM
[INDENT]when the user cilck left Menu, the forwardTo function will be called, Then the body area will be reflesh
but The iframe in body area can not be resize when the window is not maximized

How can i set resize function to iframe?

Thank you in advance

The following is my code function


forwardTo(url) {
var panel = Ext.create('Ext.ux.SimpleIFrame', {
id: 'test1',
border: false,
src: url
});
var page = Ext.create('Ext.Panel', {
id: 'iframeTest',
border: false,
header: false,
height: document.body.clientHeight - 140,
layout: 'fit',
renderTo: 'innerpage',
items: panel
});
page.show();
page.on('resize', resizeIframe('iframeTest'));
}

function resizeIframe(iframeID) {
alert(iframeID);
if (self == parent) return false;
else if (document.getElementById && document.all) /* Sniffs for IE5+.*/
var FramePageHeight = top.scrollHeight + 10;
var FramePageWidth = top.scrollWidth + 10;
alert(FramePageHeight);
parent.document.getElementById(iframeID).style.height = FramePageHeight;
parent.document.getElementById(iframeID).style.width = FramePageWidth;
}