건

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

<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-05-13 조회 2,988
08-05-08 조회 2,008
08-05-08 조회 4,097
08-04-25 조회 2,963
08-04-22 조회 3,296
08-04-21 조회 2,047
08-04-17 조회 1,446
08-04-17 조회 1,831
08-04-17 조회 1,160
08-04-17 조회 3,963
08-04-17 조회 3,270
08-04-17 조회 3,270
08-04-17 조회 2,173
08-04-17 조회 1,953
08-04-17 조회 2,485
08-04-17 조회 3,876
08-04-17 조회 3,997
08-04-17 조회 2,219
08-04-04 조회 3,310
08-04-04 조회 1,451
08-04-04 조회 1,318
08-04-04 조회 1,506
08-04-04 조회 1,262
08-04-04 조회 1,463
08-04-03 조회 1,339