Entry
Can I prevent a window from being maximized?
Apr 22nd, 2000 06:17
Martin Honnen,
You can capture
window.onresize
and check the dimensions. If they appear to be maximized resize the
window as needed:
<HTML>
<HEAD>
<STYLE>
.js {
font-weight: bold;
background-color: orange;
color: white;
}
</STYLE>
<SCRIPT>
var defaultWidth = 300;
var defaultHeight = 300;
window.onresize = function (evt) {
if ((document.all && document.body.offsetWidth >= screen.availWidth)
|| (window.outerWidth && window.outerWidth >= screen.availWidth))
window.resizeTo(defaultWidth, defaultHeight);
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE WIDTH="100%" HEIGHT="100%">
<TR>
<TD ALIGN="center" VALIGN="middle">
<A CLASS="js" HREF="http:JavaScript.FAQTs.com">
JavaScript.FAQTs.com
</A>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>