popup open position in chrome

后端 未结 6 1785
情书的邮戳
情书的邮戳 2020-12-06 09:53

When I\'m using firefox and then using window.open(\'blah.com\',\'blah\',\'left=-30,top=-300\');, the popup opens in my second display above my first one but in

6条回答
  •  长情又很酷
    2020-12-06 10:25

    I know this post is old but I've had similar problems:

    var w = 300;
    var h = 300;
    var left = (window.screen.width/2)-(w/2);
    var top = (window.screen.height/2)-(h/2);
    
    var win = window.open("example.html", "_blank", 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
    


    --centers the popup window in Firefox but not in Chrome. Also, notice, this is not outside the display area...

提交回复
热议问题