front/JS
[JS] ๋จ์ผ ๋ชจ๋ํฐ, ๋์ผ ๋ชจ๋ํฐ ํ์ ์ฐฝ ์ค์ ์ ๋ ฌ
๋ฐฐ๊ณ ํ์
2023. 10. 25. 13:47
728x90
๐ ํ์ ์ฐฝ ์ค์ ์ ๋ ฌ
- ๋จ์ผ ๋ชจ๋ํฐ
var _width = '1300';
var _height = '850';
var _left = Math.ceil(( window.screen.width - _width )/2);
var _top = Math.ceil(( window.screen.height - _height )/2);
var popupOption = 'width='+ _width +', height='+ _height +', left=' + _left + ', top='+ _top;
window.open(์ด๋ํ url, "detail_win", popupOption);
- ๋์ผ ๋ชจ๋ํฐ
var _width = '1300';
var _height = '850';
var popupX = Math.round(window.screenX + (window.outerWidth/2) - (_width/2));
var popupY = Math.round(window.screenY + (window.outerHeight/2) - (_height/2));
var popupOption = 'width='+ _width +', height='+ _height +', left=' + popupX + ', top='+ popupY;
window.open(์ด๋ํ url, "detail_win", popupOption);
๋๋ณด๊ธฐ

https://dev-handbook.tistory.com/50
์ถ์ฒ :: https://dev-handbook.tistory.com/50
[javascript] ๋ชจ๋ํฐ, ๋์ผ ๋ชจ๋ํฐ ๋ฐ ๋ธ๋ผ์ฐ์ ๊ธฐ์ค์ผ๋ก ํ์ ์ฐฝ ๊ฐ์ด๋ฐ ๋์ฐ๊ธฐ
์์ฆ์ ๋ธ๋ผ์ฐ์ ์์ ์ฌ์ฉ์ ์ธํฐํ์ด์ค๋ฅผ ๊ตฌํํ ๋ ํ์ ์ฐฝ์ ๋์ฐ๋ ์ผ์ด ๋ง์ด ์ค์์ต๋๋ค. ๊ทธ๋๋ ๊ฐ๋์ ํ์ํ๊ธฐ์ ๊ฐ๋จํ๊ฒ ํ์ ์ฐฝ์ ๋์ฐ๋ ๋ฐฉ๋ฒ์ ๋น๊ต์ ๊ฐ๋จํฉ๋๋ค. Javascript์์ wind
dev-handbook.tistory.com

์ถ์ฒ :
https://dev-handbook.tistory.com/50
๊ฐ๋ฐ ๊ณต๋ถ๋ฅผ ์ํ ๋ธ๋ก๊ทธ ์ ๋๋ค.
์ค๋ฅ๊ฐ ์๋ค๋ฉด ๋๊ธ๋ก ์๋ ค์ฃผ์ธ์!
๊ฐ์ฌํฉ๋๋ค.

728x90