항상중심에레이어띄우기
<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>
<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개
드렁크수달스
18년 전
바로 쓰겠습니다. 감사합니다.
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 716 | PHP |
|
19년 전 | 3875 | |
| 715 | PHP |
|
19년 전 | 4163 | |
| 714 | 기타 |
|
19년 전 | 3800 | |
| 713 | 기타 |
|
19년 전 | 3847 | |
| 712 | 기타 |
|
19년 전 | 3605 | |
| 711 | Linux |
|
19년 전 | 4159 | |
| 710 | MySQL |
|
19년 전 | 3812 | |
| 709 | JavaScript | 19년 전 | 2910 | ||
| 708 | 기타 | 19년 전 | 3970 | ||
| 707 | JavaScript |
|
19년 전 | 3246 | |
| 706 | 기타 |
|
19년 전 | 2842 | |
| 705 | MySQL |
|
19년 전 | 13883 | |
| 704 | Flash |
|
19년 전 | 5461 | |
| 703 | JavaScript |
|
19년 전 | 3647 | |
| 702 | 기타 | 19년 전 | 3059 | ||
| 701 | JavaScript | 19년 전 | 3295 | ||
| 700 | JavaScript | 19년 전 | 3162 | ||
| 699 | 기타 |
Power
|
19년 전 | 3546 | |
| 698 | JavaScript | 19년 전 | 3217 | ||
| 697 | JavaScript |
pearly
|
19년 전 | 5432 | |
| 696 | 기타 |
pearly
|
19년 전 | 4566 | |
| 695 | 기타 |
pearly
|
19년 전 | 4761 | |
| 694 | JavaScript |
pearly
|
19년 전 | 3863 | |
| 693 | PHP | 19년 전 | 4082 | ||
| 692 | JavaScript |
|
19년 전 | 3493 | |
| 691 | JavaScript |
pearly
|
19년 전 | 3827 | |
| 690 | 기타 | 19년 전 | 3448 | ||
| 689 | 기타 |
pearly
|
19년 전 | 4790 | |
| 688 | 기타 | 19년 전 | 4441 | ||
| 687 | 기타 |
|
19년 전 | 3070 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기