Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript to capture event for restore down or maximize

Status
Not open for further replies.

jadeite100

Programmer
May 17, 2006
19
0
0
CA
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=" 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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top