스크립트
< 자료공유 < 스크립트
스크립트자료실

기본 팝업 소스

페이지 정보

작성일13-02-27 22:44 조회1,604회

본문

<SCRIPT LANGUAGE="JavaScript">
function setCookie( name, value, expiredays )
{
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    expire_date.setHours(0,0,0,0);
    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 "";
}
 
/*
w = 459
h = 660
x = 20
y = 70
if ( getCookie( "popup_1" ) != "done" ){
    var opt = 'status=0,toolbar=0,location=0,directories=0,menubar=0,'
        + 'scrollbars=no,resizable=0,copyhistory=0,'
        + 'width='+ w +', height=' + h +', left=' + x + ', top='+ y;
    var loc = '/popup/popup.html';
    var win = window.open(loc,'popup_1',opt);
}
*/
 

/*
w2 = 458
h2 = 646
x2 = 490
y2 = 70
if ( getCookie( "popup_2" ) != "done" ){
    var opt = 'status=0,toolbar=0,location=0,directories=0,menubar=0,'
        + 'scrollbars=no,resizable=0,copyhistory=0,'
        + 'width='+ w2 +', height=' + h2 +', left=' + x2 + ', top='+ y2;
    var loc = '/popup/popup2.html';
    var win = window.open(loc,'popup_2',opt);
}
*/
</SCRIPT>

  • 페이스북으로 보내기
  • 트위터로 보내기
  • 구글플러스로 보내기