Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-24-2004, 01:18 AM   PM User | #1
rtainge
New to the CF scene

 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
rtainge is an unknown quantity at this point
Controlling the size of a new window

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>
rtainge is offline   Reply With Quote
Old 04-24-2004, 08:39 AM   PM User | #2
mpjbrennan
Regular Coder

 
Join Date: Jun 2002
Location: Newcastle, England
Posts: 178
Thanks: 0
Thanked 0 Times in 0 Posts
mpjbrennan is an unknown quantity at this point
window.open("url", "name", "height=??, width=??")

patrick
mpjbrennan is offline   Reply With Quote
Old 04-26-2004, 04:19 PM   PM User | #3
Roy Sinclair
Senior Coder

 
Join Date: Jun 2002
Location: Wichita
Posts: 3,880
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Sinclair will become famous soon enough
Fix the window.open command and it'll work.

Code:
window.open("photoGallery.htm","","Height=300,Width=300,toolbar=no,directories=no,status=no,scrollbars=no,resizeable=no,menubar=no");
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
Roy Sinclair is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:06 AM.


Advertisement
Log in to turn off these ads.