SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    seattle
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rotating images with seperate new window w/ defined size

    I am working on a web page for a charity...located at www.sandpointhousing.org/index3.htm on the page to the right in the orange are rotating images that change when you refresh or click on a new page. Currently I have the javascript that makes them rotate and then opens a new window for the stories when you click on it (though currently they all lead to the same story)

    right now the script looks like this:

    <script language="JavaScript"><!--

    //Javascript Created by Computerhope http://www.computerhope.com

    //store the quotations in arrays

    images = new Array(4);

    images[0] = "<a href = 'tony.htm' target=_blank><img src='images/tonyteaser2.gif'border=0'></a>";

    images[1] = "<a href = 'tony.htm' target=_blank><img src='images/joeteaser2.gif'border=0'></a>";

    images[2] = "<a href = 'tony.htm' target=_blank><img src='images/rachaelteaser2.gif'border=0'></a>";

    images[3] = "<a href = 'tony.htm' target=_blank><img src='images/christianteaser2.gif'border=0'></a>";

    index = Math.floor(Math.random() * images.length);

    document.write("<DL>\n");

    document.write("<DT>" + "" + images[index] + "\n");

    document.write("</DL>\n");

    //done

    // --></script>

    The problem I'm having is that I can't figure out how to control the new window size and attributes of the new window. I want width=475, hieght=525, scroll=yes, status=no, menubar=no, resizable=no

    the only ways I can find are through javascript and I'm not sure how/where to place them in the current script.

    http://www.bytesworth.com/learn/js00011.asp (this is one of the pages I was looking at- I also found things on rotating banners that went to new windows..but then they didn't define the size)

    any help would be appriciated,
    thanks
    molly

  2. #2
    SitePoint Addict
    Join Date
    Mar 2002
    Posts
    327
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try something like this:

    function show_desktop()
    {
    var win1;
    win1 = window.open("desktop.htm","desk",
    "resizable=no,height=400,width=120,alwaysRaised=yes,status=no,top=120,left=5");
    }

    Hope this helps.

    Nick
    All4YourPC for all your PC needs. Custom software.
    Websites. Web marketing. Training.
    http://members.aol.com/nickjc67


Bookmarks

Posting Permissions

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