<!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 type="text/css">
* { font-size:12px; color:#666 }
.noticePop { position:absolute; width:180px; padding:20px; background:#fff; border:#ccc solid 1px; border-radius:6px; box-shadow:1px 1px 2px rgba(0,0,0,0.3); }
.closePop { position:absolute; right:20px; top:20px; }
h4,form { margin:0; padding:0; }
label { cursor:pointer }
input { vertical-align:middle }
body{background:#efefef}
</style>
</head>
<body>
<div id="noticePop1" class="noticePop" style="left:60px; top:60px; z-index:100;">
<form name="pop_frm1" action="">
<div style="height:200px;">
<h4>공지팝업1</h4>
</div>
<div class="todayClose">
<label>
<input type="checkbox" id="toDone1" name="toDone1" onclick="noticePop1Close();" />
오늘은 그만보기</label>
</div>
<a href="javascript:closeWin1();" class="closePop">닫기</a>
</form>
<script type="text/javascript">
cookiedata = document.cookie;
if ( cookiedata.indexOf("popLayer3=done") < 0 ){
document.getElementById('noticePop1').style.visibility = "visible";
}
else {
document.getElementById('noticePop1').style.visibility = "hidden";
}
function setCookie( name, value, expiredays ) {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function noticePop1Close(){
if ( document.pop_frm1.toDone1.checked ){
setCookie( "popLayer3", "done" , 1 );
}
document.getElementById('noticePop1').style.visibility = "hidden";
}
function closeWin1(){
document.getElementById('noticePop1').style.visibility = "hidden";
}
</script>
</div>
<div id="noticePop2" class="noticePop" style="left:260px; top:180px; z-index:150;">
<form name="pop_frm2" action="">
<div style="height:200px;">
<h4>공지팝업2</h4>
</div>
<div class="todayClose">
<label>
<input type="checkbox" id="toDone2" name="toDone2" onclick="noticePop2Close();" />
오늘은 그만보기</label>
</div>
<a href="javascript:closeWin2();" class="closePop">닫기</a>
</form>
<script type="text/javascript">
cookiedata = document.cookie;
if ( cookiedata.indexOf("popLayer4=done") < 0 ){
document.getElementById('noticePop2').style.visibility = "visible";
}
else {
document.getElementById('noticePop2').style.visibility = "hidden";
}
function setCookie( name, value, expiredays ) {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function noticePop2Close(){
if ( document.pop_frm2.toDone2.checked ){
setCookie( "popLayer4", "done" , 1 );
}
document.getElementById('noticePop2').style.visibility = "hidden";
}
function closeWin2(){
document.getElementById('noticePop2').style.visibility = "hidden";
}
</script>
</div>
</body>
</html>
'Web Programing! > Script' 카테고리의 다른 글
[ 네이버 ] 스마트에디터 부모가 display:none일 경우 출력되지 않는 현상 해결하기 (0) | 2012.05.18 |
---|---|
[ JAVASCRIPT ] 일본어 전각 /반각 구별하기 (0) | 2012.05.17 |
클릭하면 펼쳐지는 토글 메뉴 (0) | 2012.03.29 |
엔터로 submit 시키기 (0) | 2012.01.14 |
팝업창 오늘하루안띄우기 (1) | 2011.11.26 |
onkeypress 사파리,파이어폭스,크롬에 적용하기 (0) | 2011.11.25 |
showModalDialog 보모창 제어 (0) | 2011.11.22 |