Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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>

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    window.open("url", "name", "height=??, width=??")

    patrick

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •