PWB and window.resizeTo()
Moderators: Tyler, Scott, PWB v2 Moderator
PWB and window.resizeTo()
Has anyone experimented with the javascript function "window.resizeTo()" in PWB?
I've written a page using this script and it works perfectly in IE, but when I use it in PWB it resizes the windows 'contents' but not the window itself, leaving large parts of the screen with empty white space.
I had just about everything in this window turned off (title bar, status bar, menus, toolbar, shellbar...) but turned it all back on to test and no difference... :(
Any help appreciated,
Greg
I've written a page using this script and it works perfectly in IE, but when I use it in PWB it resizes the windows 'contents' but not the window itself, leaving large parts of the screen with empty white space.
I had just about everything in this window turned off (title bar, status bar, menus, toolbar, shellbar...) but turned it all back on to test and no difference... :(
Any help appreciated,
Greg
I'm using PWB v2.04, IE6 and WinNT 4 SP6.
The script is :
<HTML>
<HEAD>
<TITLE>Timer</TITLE>
<script language="JavaScript">
<!--
var Led = new Array(10);
for (var i=0; i < Led.length; i++) {
Led[i] = new Image();
Led[i].src = "led" + i + ".gif";
}
function SetLED(num) {
var firstDig = Math.floor(num/100);
var secondDig = Math.floor((num-firstDig*100)/10);
var thirdDig = num-(firstDig*100)-(secondDig*10);
document.led1.src = Led[firstDig].src;
document.led2.src = Led[secondDig].src;
document.led3.src = Led[thirdDig].src;
}
var gCount = 120;
function CountDown() {
gCount--;
SetLED(gCount);
if (gCount > 0)
window.setTimeout("CountDown()",1000);
if (gCount == 0) {
top.opener=null;
top.close();
}
}
function Start() {
SetLED(gCount);
CountDown();
}
function ShrinkLeft() {
top.window.resizeTo(200, 90);
top.window.moveTo(0, 510);
alert("Shrink Left");
}
function ShrinkRight() {
top.window.resizeTo(200, 90);
top.window.moveTo(600, 510);
alert("Shrink Right");
}
-->
</script>
</HEAD>
<BODY TEXT="#FFFFFF" BGCOLOR="#848684" ALINK="#FFFFFF" VLINK="#FFFFFF" LINK="#FFFFFF" onload="javascript:Start()">
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR>
<TD VALIGN="TOP" ALIGN="LIEFT"><FONT SIZE=-1> << <A HREF="javascript:ShrinkLeft()">Shrink</A><BR> << <A HREF="javascript:ShrinkLeft()">Left</A></FONT></TD>
<TD VALIGN="TOP" ALIGN="CENTER">
<FONT SIZE=+2><B>YOU HAVE
<img name="led1" border="0" src="led0.gif" width="17" height="23">
<img name="led2" border="0" src="led0.gif" width="17" height="23">
<img name="led3" border="0" src="led0.gif" width="17" height="23">
SECONDS LEFT</B></FONT>
<BR><IMG BORDER="0" src="blink2.gif">
</TD>
<TD VALIGN="TOP" ALIGN="RIGHT"><FONT SIZE=-1><A HREF="javascript:ShrinkRight()">Shrink</A> >> <BR><A HREF="javascript:ShrinkRight()">Right</A> >> </FONT></TD>
</TR></TABLE>
</BODY>
</HTML>
If would like I can email you the whole page zipped up with gifs etc..
Ta,
Greg
The script is :
<HTML>
<HEAD>
<TITLE>Timer</TITLE>
<script language="JavaScript">
<!--
var Led = new Array(10);
for (var i=0; i < Led.length; i++) {
Led[i] = new Image();
Led[i].src = "led" + i + ".gif";
}
function SetLED(num) {
var firstDig = Math.floor(num/100);
var secondDig = Math.floor((num-firstDig*100)/10);
var thirdDig = num-(firstDig*100)-(secondDig*10);
document.led1.src = Led[firstDig].src;
document.led2.src = Led[secondDig].src;
document.led3.src = Led[thirdDig].src;
}
var gCount = 120;
function CountDown() {
gCount--;
SetLED(gCount);
if (gCount > 0)
window.setTimeout("CountDown()",1000);
if (gCount == 0) {
top.opener=null;
top.close();
}
}
function Start() {
SetLED(gCount);
CountDown();
}
function ShrinkLeft() {
top.window.resizeTo(200, 90);
top.window.moveTo(0, 510);
alert("Shrink Left");
}
function ShrinkRight() {
top.window.resizeTo(200, 90);
top.window.moveTo(600, 510);
alert("Shrink Right");
}
-->
</script>
</HEAD>
<BODY TEXT="#FFFFFF" BGCOLOR="#848684" ALINK="#FFFFFF" VLINK="#FFFFFF" LINK="#FFFFFF" onload="javascript:Start()">
<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR>
<TD VALIGN="TOP" ALIGN="LIEFT"><FONT SIZE=-1> << <A HREF="javascript:ShrinkLeft()">Shrink</A><BR> << <A HREF="javascript:ShrinkLeft()">Left</A></FONT></TD>
<TD VALIGN="TOP" ALIGN="CENTER">
<FONT SIZE=+2><B>YOU HAVE
<img name="led1" border="0" src="led0.gif" width="17" height="23">
<img name="led2" border="0" src="led0.gif" width="17" height="23">
<img name="led3" border="0" src="led0.gif" width="17" height="23">
SECONDS LEFT</B></FONT>
<BR><IMG BORDER="0" src="blink2.gif">
</TD>
<TD VALIGN="TOP" ALIGN="RIGHT"><FONT SIZE=-1><A HREF="javascript:ShrinkRight()">Shrink</A> >> <BR><A HREF="javascript:ShrinkRight()">Right</A> >> </FONT></TD>
</TR></TABLE>
</BODY>
</HTML>
If would like I can email you the whole page zipped up with gifs etc..
Ta,
Greg
Resize Issue Update?
Please could you tell me if this issue has now been resolved? We've upgraded to the latest version (v2.07), but are still having problems with window.resizeto()
Has anyone found a way round this problem?
Thanks
Tim
Has anyone found a way round this problem?
Thanks
Tim
The ResizeTo, and MoveTo, issue has been resolved and is currently being tested.
See the following post for more details.
http://teamsoftwaresolutions.com/phpBB2 ... .php?t=519
--Scott
See the following post for more details.
http://teamsoftwaresolutions.com/phpBB2 ... .php?t=519
--Scott