Getting the Popup to the center of the page for all multiple clicks

Discussion in 'JavaScript' started by tpreddi, Nov 17, 2009.

  1. #1
    Hi,

    I have a problem in bringing popup to the center of the page.

    It's not a modal popup.

    I have used var left = (screen.width - width)/2;
    var top = (screen.height - height)/2;

    first when user clicks a link , pop up will open on center of the page.

    Now user moves this popup to to the left side of the page.

    and Once again user clicks on link which opens existing popup but now this popup is not coming to the center it remains on the left side.

    So whereever it is being moved it should appear on center of the page for user multiple clicks.

    Note: all multiple clicks opens only one popup

    please help me ..it is urgent

    Thanks
    PRas
     
    tpreddi, Nov 17, 2009 IP
  2. tpreddi

    tpreddi Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    var left = (screen.width - width)/2;
    var top = (screen.height - height)/2;
    popUpObj.moveTo(left,top);

    MoveTo() works for me to force the window.

    Thanks
     
    tpreddi, Nov 18, 2009 IP