Javascript window.open Popup 중앙정렬예제

HYEONG HWAN, MUN/ 10월 18, 2014/ 미분류/ 0 comments

https://blog.lael.be/post/162

자바스크립트 팝업 중앙정렬 예제.

의외로 자주 쓰는 것 같아서 여기에 적어둔다.

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();
  }
}

 

변수명이 의미가 분명하기에 그냥 잘 해석해서 쓰면 된다.

Leave a Comment

작성하신 댓글은 관리자의 수동 승인 후 게시됩니다.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*