Javascript window.open Popup 중앙정렬예제
자바스크립트 팝업 중앙정렬 예제.
의외로 자주 쓰는 것 같아서 여기에 적어둔다.
function custom_openwin01(url,width,height){ var sst = window.open(url,'popwin','top='+((screen.availHeight - height)/2 - 40) +', left='+(screen.availWidth - width)/2+', width='+width+', height='+height+', toolbar=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0'); if(sst){ sst.focus(); } }
변수명이 의미가 분명하기에 그냥 잘 해석해서 쓰면 된다.