웹디자인 노트/웹관련 튜토리얼

새창..오늘 하루 안보게 코드

서관덕의 시간이 머문 작은공간™ 2006. 11. 16. 21:36
============================ 아래 코드를 index.html 헤드 란에 넣으세요..===

<script>
<!--
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("popup15") !="done")
{
      window.open('popup/06-06.htm','popup15','width=422,height=638,top=10,left=10');
}  

//-->
</script>


======> 여기서 변경할 껏은 제일 아래쪽에 보시면.. window.open 코드 옆에 세창 띄울 html 문서명과 크기, 위치등만 변경하시면 됩니다.^^


================================= 아래있는 코드는 새창이 뜨는 쪽에 붙여 넣어세요..^^

<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.form1.popup15.checked )
setCookie( "popup15", "done" , 1);
window.close();
}

</script>

===== 요까이가.. 헤드 테그 안에 들어가는 내용이고... 아래 코드는 본문에 들어갈 내용이기 때문에.. 원하는 위치에 넣으세요..

<form name="form1">
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
   <td width="20"><input type="checkbox" name="popup15" value="" onFocus="this.blur();"></td>
   <td><a href="closeWin()" onFocus="this.blur();">오늘 하루 닫기</a></td>
</tr>
</table>
</form>

=== 위에 있는 코드는 폼에 관련한 것은 건들지 마시고..... 문자만 알아서.. 하든지.. 이미지 넣던지 하세요..ㅋㅋㅋㅋ 알아서 넣기를..^^

바이바이.. 내가 해줄수 있는 것은 여기까지...^^  안되면.. 될때까지 맨땅에 해딩하기..^^