PDA

View Full Version : How to capture on restore down event



jadeite100
05-30-2007, 08:42 PM
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:


<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>




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.
Does anybody know the javascript to do such thing.

Any hint would be greatly appreciated.

Yours,

Frustrated.

mburt
06-01-2007, 12:06 AM
Sorry, but trying to access things outside of a browser's capabilities, as of in this case, trying to access the window, would be impossible.