[javascript] Æ˾÷ À©µµ¿ì
http://blog.naver.com/hyebaragi?Redirect=Log&logNo=80018599614 (1) ¸ð´ÏÅÍ ÇØ»óµµ(?)¸¦ ¾Ë¾Æ³»ÀÚ. °¡·Î(Æø)´Â 'screen.width', ¼¼·Î(³ôÀÌ)´Â 'screen.height'.
(2) Æ˾÷ À©µµ¿ìÀÇ Å©±â¸¦ ¾Ë¾Æ³»ÀÚ. this.document.body.clientWidth; <-- Æ˾÷ À©µµ¿ìÀÇ °¡·Î(Æø) this.document.body.clientHeight; <-- Æ˾÷ À©µµ¿ìÀÇ ¼¼·Î(³ôÀÌ)
(3) Æ˾÷ À©µµ¿ì¸¦ <ȸéÁß¾Ó>¿¡ ¶ç¿ì±â. var screenWidth = screen.width; var screenHeight = screen.height; var clientWidth = _window.document.body.clientWidth; var clientHeight = _window.document.body.clientHeight;
var screenX = ( screenWidth - clientWidth ) / 2; <-- ¸ð´ÏÅÍ Áß¾ÓÀÌ µÇ´Â X ÁÂÇ¥ var screenY = ( screenHeight - clientHeight ) / 2; <-- ¸ð´ÏÅÍ Áß¾ÓÀÌ µÇ´Â Y ÁÂÇ¥ _window.moveTo( screenX, screenY ); <-- Æ˾÷ À©µµ¿ì¸¦ ±× ÁÂÇ¥·Î À̵¿½ÃÅ°ÀÚ.
[*] Æ˾÷ À©µµ¿ì¸¦ ¶ç¿ö È°¼ºÈ ½ÃÅ°±â ¹æ¹ý 1 : Æ˾÷À» ¶ç¿ì´Â °÷¿¡¼ ó¸®ÇÏ´Â ¹æ¹ý wnd = window.open( url, window_name, properties ); wnd.focus(); ¹æ¹ý 2 : Æ˾÷¿¡¼ ó¸®ÇÏ´Â ¹æ¹ý <body onLoad='this.focus();'>
|