| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- fckeditor
- html5
- 청보리밭
- PADDING
- 클라우드
- 자동 로봇 글등록
- 배경이 가려진 레이어 팝업
- column명비교
- 다음메일
- 스크롤 이동
- addbatch
- 암호화&복호화
- 네이버 지도API
- 고창
- 2012 사진공모전
- XSS 차단
- CSS
- WEB-INF 노출
- 중복필드
- apache tomcat 연동 보안
- 자바스크립트
- 스팸글 차단
- 치환
- MARGIN
- POST 전송
- 퀵메뉴
- 비밀번호 유효성
- Java
- @tistory.com
- 일괄처리
Archives
- Today
- Total
그곰의 생활
jQuery를 이용한 배경이 가려진 레이어 팝업 뛰우기 본문
참조 : http://blog.naver.com/bluecat81/90104506981
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>배경이 가려진 레이어 팝업 뛰우기</title>
<style>
/* 마스크 뛰우기 */
#mask {
position:absolute;
z-index:9000;
background-color:#000;
display:none;
left:0;
top:0;
}
/*
팝업으로 뜨는 윈도우 css
*/
.window{
display: none;
position:absolute;
left:50%;
top:50px;
margin-left: -500px;
width:1000px;
height:500px;
background-color:#FFF;
z-index:10000;
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
//<![CDATA[
function wrapWindowByMask(){
//화면의 높이와 너비를 구한다.
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//마스크의 높이와 너비를 화면 것으로 만들어 전체 화면을 채운다.
$('#mask').css({'width':maskWidth,'height':maskHeight});
//애니메이션 효과 - 일단 0초동안 까맣게 됐다가 60% 불투명도로 간다.
$('#mask').fadeIn(0);
$('#mask').fadeTo("slow",0.6);
//윈도우 같은 거 띄운다.
$('.window').show();
}
$(document).ready(function(){
//검은 막 띄우기
$('.openMask').click(function(e){
e.preventDefault();
wrapWindowByMask();
});
//닫기 버튼을 눌렀을 때
$('.window .close').click(function (e) {
//링크 기본동작은 작동하지 않도록 한다.
e.preventDefault();
$('#mask, .window').hide();
});
//검은 막을 눌렀을 때
// $('#mask').click(function () {
// $(this).hide();
// $('.window').hide();
// });
});
//]]>
</script>
</head>
<body>
<div id = "wrap">
<div id = "container">
<div id="mask"></div>
<div class="window">
<p style="width:1000px;height:500px;text-align:center;vertical-align:middle;">팝업 내용 입력</p>
<p style="text-align:center; background:#ffffff; padding:20px;"><a href="#" class="close">닫기X</a></p>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center">
<a href="#" class="openMask">레이어 팝업 발생</a>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
'Client-side > SCRIPT' 카테고리의 다른 글
| [API] 구글 차트 (0) | 2012.03.13 |
|---|---|
| 모바일 웹에서 화면이 세로모드, 가로모드일 때 각각 다른화면 출력 (0) | 2012.03.12 |
| 자바스크립트 Form 생성하여 Post 전송 (3) | 2011.11.15 |
| 게시물 제목+URL SNS 링크 스크립트 (0) | 2011.11.07 |
| [스크랩] 비밀번호 유효성 검사 (0) | 2011.10.06 |
Comments