CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Location
    PA
    Posts
    36

    moving new window before opening it

    i'm trying to open up a new window and move it to a certain place relative to the opener window.

    this code:

    function openNew(page)
    {
    var win;
    win = window.open(page, "smallWindow", "height=400, width=650, menubar=no, toolbar=no, status=no, scrollbars=no");
    win.moveTo(450,400);
    }

    works great, except that it opens the window and THEN moves it...which kind of looks crappy. i want to be able to set the window to the new position before it is open so it looks smoother.

    are there any values i can set in the window.open() third parameter to do this (devEdge lists a screenX and screenY but i can't get those to work)? any other ideas if not?

    thanks
    b

  2. #2
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    DeveEdge was right, it is screenX and Y...but it's NS specific, and since you said it didn't work, i'm guessing that you have IE. Do some browser checking and branching, and for IE use left and top instead of screenX and Y. good luck.

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  3. #3
    Join Date
    Jan 2002
    Location
    Helsinki, Finland
    Posts
    99
    Code:
    open('about:blank','','width=200,height=200,left=400,top=400');
    puuh..BBS settings are messing the code.. :(
    Zvona - First aid for client-side web design

  4. #4
    Join Date
    Aug 2002
    Location
    PA
    Posts
    36
    exactly what i was looking for. thanks both of you.

    b

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured