Forum Moderators: open

Message Too Old, No Replies

Iframe -- with a "maximize" button and meta-refresh

In Netscape maximize stops the refresh, but it works in IE

         

scott_11

4:23 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



I'm using an iframe that refreshes every 4 seconds. On the first page, I also have a maximize button that increases the size of the iframe. In IE, it works great. It will maximize the iframe and the iframe page will continue to refresh. With Netscape 7.0, it maximizes the iframe but it stops refreshing.

Any idea why is stops refreshing in netscape and is there a way around that. See below for the test example...
Thanks

here is page2.htm...
<HTML>

<head>
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META http-equiv=Refresh content=4>
</head>

<BODY>
Page2
</body>
</HTML>

here is page1.asp....
<html>
<head>

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function maximize(){
setminmax( "iframe", "height", "445px" );
}

function setminmax( id, property, value )
{
if (navigator.userAgent.indexOf("MSIE") == -1)
{
//netscape navigator
var styleObject = document.getElementById( id );
if (styleObject!= null)
{
styleObject = styleObject.style;
styleObject[ property ]=value;
}
}
else
{
//IE
document.all[id].style[property] = value;
}
}
//-->
</SCRIPT>

</head>
<body>
<table border="3"><tr><td>
<IFRAME id=iframe style=MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px name=iframe align=center marginWidth=0 marginHeight=0 src=page2.htm frameBorder=0 width=490 scrolling=no height=185 ></IFRAME>
</td></tr></table>
<A id=maximize href="javascript:maximize();"><font color="#000000">Maximize</font></A>
</BODY>

DrDoc

8:02 pm on Mar 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

Well, you can always add a line to the code (after the iframe has been resized) that will refresh it.

Give your iframe a name, and do something like this:

framename.document.reload();

scott_11

8:59 pm on Mar 7, 2003 (gmt 0)

10+ Year Member



thanks for the info. I tried what you suggested but putting the following line in the maximize function gives a "object doesn't support property" error in IE and doesn't do anything in netscape.
Any other thoughts would be helpful.
Thanks again.

function maximize(){
setminmax( "iframe", "height", "445px" );
iframe.document.reload();
}

DrDoc

9:37 pm on Mar 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried giving it a different name than "iframe"? Using a name, such as "iframe", will cause the browser to think that you're talking about the tag, not about a frame.

Name it something like "myframe" instead. And, are you using the name attribute as well, not just the ID?

scott_11

10:08 pm on Mar 7, 2003 (gmt 0)

10+ Year Member



I changed it to the following but it didn't make a difference...

<html>
<head>

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function maximize(){
setminmax( "myframe", "height", "445px" );
myframe.document.reload();
}

function setminmax( id, property, value )
{
if (navigator.userAgent.indexOf("MSIE") == -1)
{
//netscape navigator
var styleObject = document.getElementById( id );
if (styleObject!= null)
{
styleObject = styleObject.style;
styleObject[ property ]=value;
}

}
else
{
//IE
document.all[id].style[property] = value;

}
}
//-->
</SCRIPT>

</head>
<body>
<table border="3"><tr><td>
<IFRAME id=myframe style=MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px name=myframe align=center marginWidth=0 marginHeight=0 src=page2.htm frameBorder=0 width=490 scrolling=no height=185 ></IFRAME>
</td></tr></table>
<A id=maximize href="javascript:maximize();"><font color="#000000">Maximize</font></A>
</BODY>

DrDoc

1:37 pm on Mar 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm terribly sorry...
It should be
myframe.location.reload()
Noticed that now :(

My bad ;)

scott_11

2:56 pm on Mar 8, 2003 (gmt 0)

10+ Year Member



that worked.
Thank you very much.