Making a window pop under in chrome

前端 未结 8 1368
攒了一身酷
攒了一身酷 2020-12-03 05:55

I have a button that needs to open a new window as a popup (under the parent page). In IE/Firefox, it works fine, but in chrome the popup appears over (on top of) the parent

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 06:45

    The misterious code of @dixie works for me on firefox, I.E, and almost Chrome (it doesn't focus on the main window but on the pop-up).

    To make it perfectly work on Google Chrome, I simply added this to regain focus:

    path = window.document.URL;
    window.open(path,"_self");
    

提交回复
热议问题