항상중심에레이어띄우기

<html>
<body onresize="javascript:centerWindow();" onload="centerWindow();">
<script language="JavaScript">
<!--
function centerWindow() {
var xMax = document.body.clientWidth, yMax = document.body.clientHeight;

var xOffset = (xMax-200)/2+20, yOffset = (yMax-150)/2+40;
//중심에서 오른쪽으로 20, 아래로 40픽셀에 항상 위치하는 레이어
var divMenu = document.all['Layer1'].style;
divMenu.top = yOffset;
divMenu.left = xOffset;
}
//centerWindow();
//-->
</script>

<p><div id="Layer1" style="position:absolute; left:200px; top:80px; width:200px; height:150px;
z-index:1">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor=#FFFFFF style="border:#808080 1px solid;" height=150>

<span style="font-family:굴림; font-size:9pt">항상 중심에 뜨는 <br>
레이어 샘플입니다.</span><br>
<img src="http://www.google.co.kr/images/logo_sm.gif" width="150" height="55" alt="배너">
</td>
</tr>
</table>
</div>
</body>
</html><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]</div>
|

댓글 1개

바로 쓰겠습니다. 감사합니다.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
19년 전 조회 2,947
19년 전 조회 2,793
19년 전 조회 3,337
19년 전 조회 6,272
19년 전 조회 2,176
19년 전 조회 1,980
19년 전 조회 1,933
19년 전 조회 1,993
19년 전 조회 3,180
19년 전 조회 2,249
19년 전 조회 1,942
19년 전 조회 1,614
19년 전 조회 2,067
19년 전 조회 3,351
19년 전 조회 3,200
19년 전 조회 1,897
19년 전 조회 1,469
19년 전 조회 3,161
19년 전 조회 2,041
19년 전 조회 1,608
19년 전 조회 2,825
19년 전 조회 1,955
19년 전 조회 1,830
19년 전 조회 1,805
19년 전 조회 1,769
🐛 버그신고