window.open to center of screen

后端 未结 4 734
青春惊慌失措
青春惊慌失措 2021-02-05 13:47

I am using window.open to open a popup window like so:

4条回答
  •  滥情空心
    2021-02-05 14:16

    Edit

    This is a bad answer. a much better answer can be found here: window.open() on a multi-monitor/dual-monitor system - where does window pop up?

    But in the meantime while i decide when i want to update this answer, this fiddle accounts for dual monitor setups: http://jsfiddle.net/w665x/138/

    Original Answer

    This might work for you. Not confident in it being entirely cross-browser, but close;

    
    
    
    
    
    blah
    
    
    

    Fiddle!

提交回复
热议问题