괜찮은 레이어 팝업창 소스

<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() {
    if ( document.notice_form.chkbox.checked ){
        setCookie( "maindiv", "done" , 1 );
    }
    document.all['divpop'].style.visibility = "hidden";
}
//--> 
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> 


<!-- POPUP -->
<div id="divpop" style="position:absolute;left:395px;top:190;z-index:200;visibility:hidden;">
<table width=300 height=400 cellpadding=2 cellspacing=0>
<tr>
    <td style="border:1px #666666 solid" height=360 align=center bgcolor=white>
    여기에 내용 삽입
    </td>
</tr>
<tr>
        <form name="notice_form">
    <td align=right bgcolor=white>
        <input type="checkbox" name="chkbox" value="checkbox">오늘 하루 이 창을 열지 않음
        <a href="javascript:closeWin();"><B>[닫기]</B></a>
    </td>
</tr>
        </form>
</table>
</div> 

<script language="Javascript">
cookiedata = document.cookie;   
if ( cookiedata.indexOf("maindiv=done") < 0 ){     
    document.all['divpop'].style.visibility = "visible";
    }
    else {
        document.all['divpop'].style.visibility = "hidden";
}
</script>
 
 
 
 
 
많은 소스중에서 제일 괜찮더군요.
 
잘 사용하세요^^
[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]
|

댓글 9개

아, 감사합니다. 잘 쓸게요.
감사합니다.
팝업창을 여러 개 띄우려면 어떻게 해야 하는지...ㅠㅠ
좋은자료 감사합니다.
좋은자료 감사드려요.
필요했던 건데 잘 쓰겠습니다.
괜찮은 레이어 팝업창 소스
댓글을 작성하시려면 로그인이 필요합니다.

팁게시판

디자인과 관련된 유용한 정보를 공유하세요. 질문은 상단의 QA에서 해주시기 바랍니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 1,889
18년 전 조회 3,639
18년 전 조회 1,965
18년 전 조회 3,098
18년 전 조회 4,723
18년 전 조회 2,854
18년 전 조회 8,024
18년 전 조회 4,040
18년 전 조회 2,730
18년 전 조회 1,509
18년 전 조회 2,610
18년 전 조회 5,025
18년 전 조회 5,204
18년 전 조회 2,083
18년 전 조회 4,343
18년 전 조회 4,086
18년 전 조회 4,139
18년 전 조회 2,259
18년 전 조회 4,181
18년 전 조회 2,163
18년 전 조회 3,272
18년 전 조회 4,901
18년 전 조회 1,944
18년 전 조회 3,358
18년 전 조회 1,633
🐛 버그신고