웹마스터 팁

확실히 되는 소스입니다.

예시될 만한 사이트라곤 제가 돈받고 맹근 홈피밖에 없어서 예시는 생략합니다.

팝업을 "띄우는" 명령을 해주는 메인페이지와 팝업공지가 "뜬" 팝업창, 이 두군데에 각각 들어갑니다.

디자인은 각자에 맞게 하세요.

[수정,추가사항]
자스 코드에 보면 날짜지정할 수 있는 부분이 있습니다.
이 부분이 설명이 빠져서 다시 수정합니다.
쭉 내려서 보시다 보면 팝업창 스크립트에서 그 부분에 주석 달아놨으니 원하시는대로 변경하여 쓰세요^^

메인창의 헤드부분-------------------------------------------------------------------
<SCRIPT LANGUAGE="JavaScript">
<!--
function change(form)
{
if (form.url.selectedIndex !=0)
parent.location = form.url.options[form.url.selectedIndex].value
}
function setCookie( name, value, expiredays )
{
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( name )
{
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}
if ( getCookie( "Notice" ) != "done" )
{
        noticeWindow  =  window.open('popup.html','notice','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=395,height=285');//이부분을 자기에 맞게 변경하세요
        noticeWindow.opener = self;
}
// -->
</SCRIPT>

팝업창 -------------------------------------------------------------------------------
<html>
<head>
<title>::알림::</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<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.forms[0].Notice.checked )


                setCookie( "Notice", "done" , 1); //1이란 숫자는 1일간 안보임을 뜻합니다. 날짜는 자신에 맞게 수정하세요

        self.close();
}
// -->
</SCRIPT>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
    <td align="center" height=70>공지내용</td>
  </tr>
  <tr>
    <td height="40" align="center">
     <form>
        <input type="checkbox" name="Notice" value="">앞으로 창 표시하지 않음.  
        <a href="#" onClick="javascript:history.onclick=closeWin()">닫기</a>
      </form>
    </td>
  </tr>
</table>
</body>
</html>