건

쿠키를 이용한 레이어 공지창 (오늘 하루 열지 않음 기능을 레이어로)

· 2008-04-17 (목) 01:28:50 · 2786 · 1

<html>
<head>
    <title>http://www.blueb.co.kr</title>

<script language="JavaScript">
<!--
function setCookie( name, value, expiredays ) {
    var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
    }

function closeWin() {
    if ( document.notice_form.chkbox.checked ){
        setCookie( "maindiv", "done" , 1 );
    }
    document.all['divpop'].style.visibility = "hidden";
}
//--> 
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> 


<!-- POPUP -->
<div id="divpop" style="position:absolute;left:395px;top:190;z-index:200;visibility:hidden;">
<table width=300 height=400 cellpadding=2 cellspacing=0>
<tr>
    <td style="border:1px #666666 solid" height=360 align=center bgcolor=white>
    여기에 내용 삽입
    </td>
</tr>
<tr>
        <form name="notice_form">
    <td align=right bgcolor=white>
        <input type="checkbox" name="chkbox" value="checkbox">오늘 하루 이 창을 열지 않음
        <a href="javascript:closeWin();"><B>[닫기]</B></a>
    </td>
</tr>
        </form>
</table>
</div> 

<script language="Javascript">
cookiedata = document.cookie;   
if ( cookiedata.indexOf("maindiv=done") < 0 ){     
    document.all['divpop'].style.visibility = "visible";
    }
    else {
        document.all['divpop'].style.visibility = "hidden";
}
</script>

[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]
|

댓글 1개

담아갑니다. 감솨해요!!!!
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

6,077건

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
08-07-06 조회 2,326
08-05-21 조회 3,485
08-05-13 조회 3,351
08-04-17 조회 3,717
08-02-19 조회 2,497
08-01-18 조회 2,701
08-01-10 조회 2,694
07-10-22 조회 2,427
07-10-09 조회 3,169
07-10-03 조회 2,411
07-07-06 조회 2,981
07-07-06 조회 3,340
07-07-06 조회 2,957
07-06-28 조회 2,509
07-06-05 조회 2,372
07-06-05 조회 2,920
07-05-30 조회 2,249
07-05-02 조회 2,649
07-04-15 조회 4,003
07-04-11 조회 2,552
07-04-05 조회 2,824
07-03-31 조회 2,062
07-03-31 조회 2,990
07-03-30 조회 2,678
07-03-24 조회 2,979