popup open position in chrome

后端 未结 6 1777
情书的邮戳
情书的邮戳 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:30

    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);
    win.moveTo(left, top);
    

    for Chrome...

提交回复
热议问题