일반 팝업 타입 1
function popup(url, w, h, name, option) {
var pozX, pozY;
var sw = screen.availWidth;
var sh = screen.availHeight;
var scroll = 0;
if (option == 'scroll') {
scroll = 1;
}
pozX = (sw - w) / 2;
pozY = (sh - h) / 2;
window.open(url, name, "location=0,status=0,scrollbars=" + scroll + ",resizable=1,width=" + w + ",height=" + h +
",left=" + pozX + ",top=" + pozY);
}
일반 팝업 타입 2
function winPop(url, opts) {
var popupName = opts.name || 'popup';
var options = '';
options += 'width=' + (opts.width ? opts.width : 200) + ', height=' + (opts.height ? opts.height : 200);
options += opts.left && opts.width ? ', left=' + opts.left : ', left=' + ( (screen.availWidth - opts.width) / 2);
options += opts.top && opts.height ? ', top=' + opts.top : ', top=' + ( (screen.availHeight - opts.height) / 2);
options += opts.scrollbars ? ', scrollbars=' + opts.scrollbars : ', scrollbars=no';
options += opts.resizable ? ', resizable=' + opts.resizable : ', resizable=no';
console.log(popupName);
window.open(url, popupName, options);
}
Related links
Jaehee's WebClub
'Code Lab' 카테고리의 다른 글
Layer Pop-up(레이어 팝업) - 플러그인 타입 코드 (0) | 2016.09.29 |
---|---|
Layer Pop-up (레이어 팝업) (20) | 2016.09.29 |
심플 애니 레이어팝업 (3) | 2016.09.29 |
thumbnail list banner #2(플러그인 타입) (0) | 2016.09.13 |
thumbnail list banner #1 (ver1. 함수형 타입) (0) | 2016.09.12 |