2011-03-01 2 views
3

현재 창 위치에 따라 자바 스크립트 팝업을 열려고합니다. 나는 이중 모니터 설정을 가지고 있으며 크롬 이외의 모든 다른 브라우저에서 작동합니다. 어떤 이유로 크롬이 내 두 번째 모니터에있을 때 팝업이 오른쪽으로 이동합니다.듀얼 모니터에서 Chrome Javascript 팝업이 꺼져 있습니다.

var winX = (document.all) ? window.screenLeft : window.screenX; 
var winY = (document.all) ? window.screenTop : window.screenY; 

var newWindowWidth = 650; 
var newWindowHeight = 700; 

var currentWindowWidth = $(window).width(); 
var currentWindowHeight = $(window).height(); 

var newWindowX = (winX + (currentWindowWidth/2)) - (newWindowWidth/2); 
var newWindowY = (winY + (currentWindowHeight/2)) - (newWindowHeight/2); 

window.open("", "configurationWindow", "scrollbars=1,resizable=yes,width=" + newWindowWidth + ",height=" + newWindowHeight + ",top=" + newWindowY + ",left=" + newWindowX); 

답변

관련 문제