게시글 Move 할때 나오는 팝업창 위치 센터로
본문
게시글 Move 할때 나오는 팝업창 위치를
모니터 정중앙으로 Fix 할려면 어떻게 해야 하나요?
답변 2
자바스크립트 윈도우 객체 중에서 innerWidth 와 innerHeight 를 사용하였습니다.
screen.width 나 screen.height 등 다른 것들을 사용해도 괜찮습니다.
list.skin.php 에서 아래의 구문을 찾습니다.
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
다음처럼 고쳐줍니다.
moveX = (innerWidth - 500) / 2 ;
moveY = (innerHeight - 550) / 2;
var sub_win = window.open("", "move", "left=" + moveX + ", top=" + moveY + ", width=500, height=550, scrollbars=1");
list.skin.php 하단 스크립트 중에 아래내용
function select_copy(sw) {
var f = document.fboardlist;
if (sw == "copy")
str = "복사";
else
str = "이동";
var sub_win = window.open("", "move", "left=50, top=50, width=500, height=550, scrollbars=1");
f.sw.value = sw;
f.target = "move";
f.action = g5_bbs_url+"/move.php";
f.submit();
}
left=710
ex)1920/2-250=710
이렇게 하면 됩니다.
비타주리님께서 정답을 하신줄 모르고 글을 올렸습니다. 제 글은 무시하세요.
!-->
답변을 작성하시기 전에 로그인 해주세요.