Results 1 to 3 of 3

Thread: Popup adjustment to different solution + centering the popup on screen PLEASE HELP!

  1. #1
    Join Date
    Oct 2004

    Popup adjustment to different solution + centering the popup on screen PLEASE HELP!


    I really don't know very much about Java script until now, as I just use paragraphs of code 'copy&pasting' them to my site. My problem is the following.

    On my startpage I have an 'if' loop implemented, that opens a popup window in a certain size, according to the screen resolution the computer uses.

    However what I want is, that the window is opened centered as well. How do I amend the code so that it works. At the moment the code looks like this:

    function MM_openBrWindow(theURL,winName,features) { //v2.0
    if (screen.width > 1000)
    window.open("folio.htm", "_blank", "left=5,top=5,width=1003,height=639,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0 ");
    else if (screen.width < 1020)
    window.open("folio2.htm", "_blank", "width=780,height=500,toolbar=0,menubar=0,location=0,status=0,resizable=0,scrollbars=0");

    function winOpen(url, breite, hoehe) { // Errechnet Koordinaten, um das Popup zentriert zu platzieren
    links = (screen.width/2)-(breite/2);
    oben = (screen.height/2)-(hoehe/2);
    window.open(url,"popup","height="+hoehe+",width="+breite+",status = no,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars = no,fullscreen = no,top ="+oben+",left ="+links);

    Please help me. I'm so lost...

  2. #2
    Join Date
    Jul 2004
    Singapore, SG
    Java is not javascript. Post this in the javascript forum. [or a mod move this to the js forum]

    FYI: use the moveTo(width,height) method of the window object will solve your problem.

  3. #3
    Join Date
    Oct 2004
    Sorry 'bout that. It's in the java script section now...


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles