Set/Get Cookie & Layer

<!-- 레이어 팝업 --> <style type="text/css"> body {position:relative;} .popup-wrap {display:none; z-index:999; position:absolute; left:0; top:0; width:100%; height:100%; background-color:rgba(0,0,0,0.8);} .popup-area {position:fixed; left:50%; top:40px; width:800px; margin-left:-400px;} .popup-area a {display:block;} </style> <div class="popup-wrap" id="popup-id"> <div class="popup-area"> <a href="#" onclick="popupClose(); return false;"><img src="/images/league/main/league_layer.jpg" alt="1월29일 개막!" title="오늘 하루 그만보기" /></a> </div> </div> <script type="text/javascript"> function getCookie(name){ var wcname = name + '='; var wcstart, wcend, end; var i = 0; while(i <= document.cookie.length) { wcstart = i; wcend = (i + wcname.length); if(document.cookie.substring(wcstart, wcend) == wcname) { if((end = document.cookie.indexOf(';', wcend)) == -1) end = document.cookie.length; return document.cookie.substring(wcend, end); } i = document.cookie.indexOf('', i) + 1; if(i == 0) break; } return ''; } function setCookie(name, value, expiredays) { var today = new Date(); today.setDate(today.getDate() + expiredays); document.cookie = name + '=' + escape(value) + '; path=/; expires=' + today.toGMTString() + ';'; } function popupClose() { setCookie('popupLayer', true, 1); document.getElementById('popup-id').style.display='none'; } if(!getCookie('popupLayer')) { document.getElementById('popup-id').style.display='block'; } </script> <!-- //레이어 팝업 -->
- '오늘 하루 그만보기' 팝업 레이어
- 쿠키 Get / Set

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.