Hi:
I am using IE 6 SP2.
I needed to resize an iFrame when the window is resize. And the only way I know how is to called a javascript function when the resize event occur.
I can capture the event when the window is resize on a simple html but when I used with an actual application, the resize event doesnot get trigger when I changed the size of the window. I believed the reason is because if the url the IFrame references also has a resize event in its body it interferes with the resize event outside of the iframe.
Here is my javascript code:
The alternative for me is to capture the event when the user click on the "restore down" or when the user click on "maximize" button in the popup.<html>
<head>
<script type="text/javascript">
window.onresize = test2;
function shrinkIFrame()
{
alert("load event!");
}
function test2()
{
alert("test1,window.onresize");
}
function test1()
{
alert("test1,onresize");
}
</script>
</head>
<body onLoad="shrinkIFrame();" onresize="test1();">
<p>Resize the browser window to fire the resize event.</p>
<iframe src="http://www.google.ca" name="dataFrame" id="dataFrame" style="height:942.0px; width:100%" scrolling="NO" frameborder="0"></iframe>
</body>
</html>
Does anybody know the javascript to do such thing.
Any hint would be greatly appreciated.
Yours,
Frustrated.



Reply With Quote

Bookmarks