야야곰 경험

홈페이지 관리 / 체크 박스 클릭하면 하루동안 팝업창 안 열리게 하기

디디대장 2010. 2. 27. 09:50
반응형
체크 박스 클릭하면 하루동안 팝업창 안 열리게 하기

아래의 소스를 새창을 띄울 부모문서의 <head></head>사이에 넣어 주세요 



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

//폼의 체크 박스를 체그 하면 새창이 나타나지 않으며, 체크 하지 않았을 경우, 계속 나타납니다. 

if ( getCookie( "Notice" ) != "done" ) { 
//새창으로 열릴 페이지의 경로 및 크기와 위치를 지정해 주세요. 
noticeWindow  =  window.open('http://bundong.com/popup/popup_20100404.html','_blank','width=396,height=600,top=50,left=150'); 
noticeWindow.opener = self; } 

// --> 
</SCRIPT> 




아래의 소스를 새창으로 열릴 문서의 <head>와</head>

<span class="key1" onclick="keyword_open('/kview.php?kd=%ED%83%9C%EA%B7%B8+')">태그 </span>사이에 넣어주세요 



<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.pop.Notice.checked ) 
setCookie( "Notice", "done" , 1);//1은 하루동안 새창을 열지 않게 합니다. 
window.close(); 
// --> 
</SCRIPT> 


아래의 소스를 새창으로 새창으로 열릴 문서의  <body>와</body>





<span class="key1" onclick="keyword_open('/kview.php?kd=%ED%83%9C%EA%B7%B8+')">태그 </span>사이에 넣어주세요 





<form name=pop> 
<p align="center"> 
<input type=checkbox name="Notice" value="">다음부터 공지창 띄우지 않음<a href="javascript:history.onclick=closeWin()">[닫기]</a>   
</form> 
반응형
- 구독과 공감(♥)은 눌러주세요 -