본문 바로가기
JavaScript

JavaScript 팝업창 열기

by ddss6565 2023. 7. 16.
var url = "https://www.naver.com";
var name = "_blank";
var specs = new Array();

var width = 1024;
var height = 800;

var popupX = (window.screen.width / 2) - (width / 2);
var popupY = (window.screen.height / 2) - (height / 2);

specs.push("width=" + width);
specs.push("height=" + height);
specs.push("left=" + popupX);
specs.push("top=" + popupY);
specs.push("resizable=" + "no");

window.open(url, name, specs.join(","));
반응형

댓글