나도 아직 테스트 해보지 못한것.
<!-- 레이어팝업 -->
<script type = "text/javascript">
/* 쿠키 관련 */
function getCookie1(cookieName){
thisCookie = document.cookie.split("; ");
for(i=0; i<thisCookie.length; i++){
if(cookieName == thisCookie[i].split("=")[0]){
return thisCookie[i].split("=")[1];
}
}
return "";
}
function setCookie1(cookieName, value, expiretime) {
var testText = '' + expiretime;
if (expiretime) {
var expiredate = '';
if (expiretime == 'infinite') {
expiredate = 'Tue, 12 Dec 2999 23:59:59 UTC ';
} else if (testText.search(new RegExp(':', 'g')) > -1) {
expiredate = expiretime;
} else {
var todayDate = new Date();
todayDate.setHours(todayDate.getHours() + expiretime);
expiredate = todayDate.toGMTString();
}
document.cookie = cookieName + "=" + escape(value) + "; path=/; expires=" + expiredate + "; domain=.koreafocus.or.kr;";
} else {
document.cookie = cookieName + "=" + escape(value) + "; path=/; domain=.koreafocus.or.kr;";
}
}
function eventShowPopup() {
var obj = document.getElementById("eventPopup");
if(getCookie1("event_pop") != "1"){
obj.style.display = 'block';
}
}
function eventDisablePopup(){
setCookie1("event_pop", "1" , 12);
eventHidePopup();
}
function eventHidePopup() {
var obj = document.getElementById("eventPopup");
obj.style.display = 'none';
}
</script>
<div id="eventPopup" style="top: 144px; left: 282px; width: 414px; position: absolute; display: none;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><img src="/design3/popup/images/popup_120131.jpg" /></td>
</tr>
<tr>
<td style="background-color: #000; font-size: 11px; color: #fff; padding: 3px 0px 3px 8px; font-family: dotum; text-align: left;"><input id="eventPopupNomore" type="checkbox" onfocus="this.blur();" onclick="eventDisablePopup();" style="border: none;"> <label for="eventPopupNomore">하루 동안 이 창을 열지않음</label></td>
<td style="background-color: #000; font-size: 11px; color: #fff; padding: 3px 8px 3px 0; font-family: dotum; text-align: right;"><a href="javascript:eventHidePopup();" style="color: #fff; text-decoration: none;">[닫기]</a></td>
</tr>
</table>
</div>
<script type = "text/javascript">eventShowPopup();</script>
<!-- //레이어팝업 -->
[출처] 레이어팝업_오늘하루 창닫기|작성자 휘성별님
'퍼블리싱 > HTML | CSS | Javascript' 카테고리의 다른 글
크로스 브라우징 관련 js (1) | 2017.04.26 |
---|---|
jquery cdn주소 (0) | 2017.04.26 |
select박스로 페이지 이동하기 (링크걸기) (0) | 2017.04.07 |
마우스우클릭방지 / 선택방지 / 드래그방지 (0) | 2017.04.05 |
css rwd grid (0) | 2017.04.05 |