...

View Full Version : Controlling the size of a new window



rtainge
04-24-2004, 01:18 AM
I've written a script that, among other things, opens a new window, but how can I control it's size? Thanks in advance!

-rtainge

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>RecordSet Test Page</TITLE>

<OBJECT ID="thumbnails"
CLASSID="CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83">
<PARAM NAME="DataURL" VALUE="thumbnails2.txt">
<PARAM NAME="UseHeader" VALUE="True">
<PARAM NAME="TextQualifier" VALUE="@">
<PARAM NAME="FieldDelim" VALUE="|">
</OBJECT>

<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of the script

function start()
{
var recordSet = thumbnails.recordset;
var photoArray = new Array();
var lastRecord;

recordSet.MoveLast();
lastRecord = recordSet.absolutePosition;
recordSet.MoveFirst();

for(var countX=0; countX<lastRecord; countX++)
{
photoArray[countX] = new Array(5);

photoArray[countX][0] = imageName.innerText;
photoArray[countX][1] = imageLink.innerText;
photoArray[countX][2] = thbWidth.innerText;
photoArray[countX][3] = thbHeight.innerText;
photoArray[countX][4] = thbAlt.innerText;
recordSet.MoveNext();
//imageSpace.innerText = "Test: " + photoArray[countX][0];
}

var imageString = "";

for(var i=0; i<lastRecord; i++)
{
imageString = imageString + ("<A HREF=\"JavaScript:OnClick=openPhotoGallery(" + i + ")\">");
imageString = imageString + ("<IMG SRC=\"" + photoArray[i][1] + "\" WIDTH=\"" + photoArray[i][2]);
imageString = imageString + ("\" HEIGHT=\"" + photoArray[i][3] + "\" ALT=\"" + photoArray[i][4] + "\"></A>");
imageString = imageString + ("<IMG SRC=\"thumbnails/spacer.jpg\"> ");
}
imageSpace.innerHTML = imageString;
}

function openPhotoGallery(imgNum)
{
window.open(wintype="photoGallery.htm",winHeight="300", winWidth="300",toolbar="no",directories="no",status="no",scrollbars="no",resizeable="no",menubar="no");
}

// End of the script -->
</SCRIPT>
</HEAD>
<BODY ONLOAD="start()">
<SPAN ID="imageName" DATASRC="#thumbnails" DATAFLD="linksToImage"></SPAN>
<SPAN ID="imageLink" DATASRC="#thumbnails" DATAFLD="thumbnail"></SPAN>
<SPAN ID="thbWidth" DATASRC="#thumbnails" DATAFLD="tWidth"></SPAN>
<SPAN ID="thbHeight" DATASRC="#thumbnails" DATAFLD="tHeight"></SPAN>
<SPAN ID="thbAlt" DATASRC="#thumbnails" DATAFLD="tAlt"></SPAN>

<BR><BR>
<TABLE WIDTH="100%" HEIGHT="60" BORDER="0">
<TR>
<TD CELLPADDING="0" CELLSPACING="0" HEIGHT="60">
</MARQUEE>
<P ID="imageSpace"> </P>
</MARQUEE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

mpjbrennan
04-24-2004, 08:39 AM
window.open("url", "name", "height=??, width=??")

patrick

Roy Sinclair
04-26-2004, 04:19 PM
Fix the window.open command and it'll work.



window.open("photoGallery.htm","","Height=300,Width=300,toolbar=no,directories=no,status=no,scrollbars=no,resizeable=no,menubar=no");



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum