我有一個動態傳遞的Div數據。 我想在某些事件觸發後在彈出窗口中打開該div數據。 我完成了我的代碼。但是,當彈出在我的瀏覽器是開放的不居中對齊。其在角落未來..Window.popup在瀏覽器中居中對齊
我的代碼: -
var w = 620;
var h = 360;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var divText = document.getElementById("inviteConfirmationMessage").outerHTML;
var myWindow = window.open('','','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
var doc = myWindow.document;
doc.open();
doc.write(divText);
doc.close();
在Mozilla Firefox工作,但在Chrome中不工作 -
請幫我!或任何指導。
可能重複(http://stackoverflow.com/questions/5681415/how-to-center-彈出窗口) – epascarello