이야기
하루동안 팝업열지 않기
팝업으로 띄울 페이지에 아래 소스를 넣습니다.
--------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>:::::pop test:::::</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<style type="text/css">
<!--
.unnamed1 {
        font-size: 12px;
        line-height: 150%;
        color: #333366;
}
-->
</style>
<SCRIPT language="JavaScript"> 
<!-- 

// 쿠키를 만듭니다. 아래 closeWin() 함수에서 호출됩니다 

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.pop.Notice.checked ) 
        setCookie( "Notice", "done" , 1);  // 오른쪽 숫자는 쿠키를 유지할 기간을 설정합니다 
        self.close(); 

// --> 

</SCRIPT> 
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="293" border="0" cellpadding="0" cellspacing="0" background="img/open-0331.gif">
  <tr> 
    <td height="320"> </td>
  </tr>
  <tr> 
    <form name=pop>
      <td width="300" height="32" valign="top"><div align="center"> 
          <input type=checkbox  name="Notice" value="">
          <span class="unnamed1">오늘열지않기</span> <a href="javascript:history.onclick=closeWin()"><img src="img/out.gif" width="50" height="16" align="absmiddle" border="0"></a> 
        </div></td>
    </form>
  </tr>
</table>
</body>
</html>
-----------------------
다음 메인 페이지에 아래 소스를 넣고 경로를 자기의 것으로 고치세요.

<SCRIPT LANGUAGE="JavaScript">
<!--
<!-- 

// 쿠키가 있나 찾습니다 

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 ""; 


// 팝업창에서 만들어진 쿠키 Notice 의 값이 done 이 아니면(즉, 체크하지 않으면,) 
// 공지창 (new.htm) 을 띄웁니다 

if ( getCookie( "Notice" ) != "done" ) { 
        noticeWindow  =  window.open('공지창경로','notice','left=0, top=0, width=넓이값,height=높이값,top=20,left=20'); 
        noticeWindow.opener = self; 
}

</SCRIPT> 

이 게시물을

에디터 선택

※ 주의 : 페이지가 새로고침됩니다

이 댓글을 삭제하시겠습니까?

SEARCH