회원에게 공개되는 공간입니다. 올려진 팁이나 자료가 절대적으로 옳은 방법은 아닙니다. 다양한 방법중 하나의 방법임을 이해해 주시기 바라며, 보다 나은 방법이 있거나 궁금한 사항이 있으시면 댓글로 참여해 주시면 감사하겠습니다.
글 수 219
XE 사이트에 공개되는 팝업창 모듈 및 위젯이 버전 업데이트 때마다 문제가 있어서 급하게 팝업창을 띄우려고 할때 잠시 방황(?) 했던 기억으로 레이아웃 소스에 직접 코드를 추가하여 팝업창을 띄우는 방법을 소개 합니다.
메인 레이아웃이 설정에 들어가 헤드스크립트 부분에 아래 소스를 넣습니다.
위에서 /xe/popup_cont.html 이부분이 띄워질 팝업창 이름이고 , width=500,height=500 이 부분이 가로와 세로폭입니다.
그 뒤의 속성들도 보시면 아실듯..
그다음으로 팝업창이 띄워질 popup_cont.html 파일의 소스를 살펴보면
이런식으로해주면 됩니다.
이 이미지도 열려서 함께 사용하면 좀더 보기 좋겠지요.
이 이미지가 올려질 경로는 xe/images/close.gif 입니다. 물론 자신의 계정에 따라 경로도 바꿔서 처리 하시면 됩니다.
메인 레이아웃이 설정에 들어가 헤드스크립트 부분에 아래 소스를 넣습니다.
<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 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("p_1") != "done")
{
wint1=window.open('/xe/popup_cont.html','chk_1','width=500,height=500,left=20,top=80,marginwidth=0,marginheight=0,resizable=0,scrollbars=0');
wint1.opener = self;
}
//-->
</script>위에서 /xe/popup_cont.html 이부분이 띄워질 팝업창 이름이고 , width=500,height=500 이 부분이 가로와 세로폭입니다.
그 뒤의 속성들도 보시면 아실듯..
그다음으로 팝업창이 띄워질 popup_cont.html 파일의 소스를 살펴보면
<html>
<head>
<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()
{
setCookie( "p_1", "done" , 1);
self.close();
}
function closeWin2()
{
self.close();
}
</script>
</head>
<body topmargin='0' leftmargin='0'>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan='3'>
<img src=/xe/images/alonepopup.gif>
</td>
</tr>
<tr>
<td align='right' style='padding:0px 20px;'>
<input type=checkbox name=name onClick=closeWin()>
<font color="#868686" class="small" size='2pt'>오늘하루 창 띄우지 않기</font>
<a href="#" onclick='closeWin2()'><img src='/xe/images/close.gif' border='0' align='absmiddle'></a>
</td>
</tr>
</table>
</body>
이런식으로해주면 됩니다.
이 이미지가 올려질 경로는 xe/images/close.gif 입니다. 물론 자신의 계정에 따라 경로도 바꿔서 처리 하시면 됩니다.










XE강좌

Tip/Tech 
