2014년 4월 28일 월요일

팝업 창 중앙에 띄우기


브라우저의 팝업 창을 중앙으로 띄우기.

function windowOpenCenter(url, parm, width, height) {
var sw  = screen.availWidth ;
var sh  = screen.availHeight ;

px=(sw - width)/2 ;
py=(sh - height)/2 ;

var set  = 'top=' + py + ',left=' + px ;
set += ',width=' + width + ',height=' + height + ',toolbar=0,resizable=1,status=0,scrollbars=1' ;

   window.open (url + '?' + parm , '' , set) ;
}

댓글 없음:

댓글 쓰기