메뉴 건너뛰기

조회 수 7166 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
<style type="text/css">

#poplayer_No { position:absolute; font-family:굴림; font-size:12px; border:1px solid #000000;width:400; VISIBILITY: hidden;}

.notice { left:170; top:170; height:22; color:#ffffff; font-weight:bold; background-color:orange; padding:5; width:400; cursor:move;}

.contents { clear:both; width:320; height:280; padding:0}

.winClose { width:65; height:16; background-color:#ffffff; padding:5 5 0 5; font-weight:bold; cursor:pointer;}

</style>

<script language="javascript">

window.onload = function() {

    with(document) {

        getElementById("layer_move").onmousedown = function() { onMove_layer(1); }

        getElementById("htmlMove").onmousemove = getMove;

        getElementById("htmlMove").onmouseup = function() { onMove_layer(0); };    

        getElementById("notNote").onclick = function() { noticeClose('poplayer_No',1); };        

        getElementById("winClose").onclick = closeWin;

    }

}

//---------------------------------------------Layer Move---------------------------------------------------------//

var move_on, x_styleLeft, y_styleTop, x_accept, y_accept;

move_num = 0;

function onMove_layer(chk) {

    var val = document.getElementById("poplayer_No");

    if (chk ==1) {

        x_styleLeft = event.clientX - val.offsetLeft;

        y_styleTop = event.clientY - val.offsetTop;

    }

    move_num = chk;

}

function getMove() {

    var val = document.getElementById("poplayer_No")

    if (move_num == 1) {

        x_accept = event.clientX - x_styleLeft;

        y_accept = event.clientY - y_styleTop;

        if (x_accept > 1) { val.style.left = x_accept }

        if (y_accept > 1) { val.style.top = y_accept }

    }

}

//-------------------------------------------------PopCookies-----------------------------------------------------------------//

//팝업을 그만 띄운다.

function SetNoticeCookie(name, day) {

    var ExpDate = new Date();

    ExpDate.setDate(ExpDate.getDate() + day);

    document.cookie = name + "=" + escape("No") + "; path=; expires=" + ExpDate.toGMTString() + ";" 

}

//팝업창을 띄우기전 사용자의 쿠키를 체크

function getNoticeCookie(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 ""; 

}         

</script>

<body id="htmlMove">

<div id="poplayer_No" name="poplayer_No">

    <div class="notice" id="layer_move">▒  이벤트 안내 ▒</div>

    <div class="contents">

<table id="Table_01" style="width: 00px;" border="0" cellspacing="0" cellpadding="0" align="center">

<tbody>

<tr>

<td>팝업 내용</td>

</tr>

</tbody>

</table>

</div>

    <div style="text-align:bottom">

        <div style="text-align:right">

            <input type="checkbox" id="notNote">오늘 하루 뛰우지 않음 <span class="winClose" id="winClose">[ 닫기 ]</span>

        </div>

    </div>

</div>

<script language="javascript">

function noticeShow(divid){

    var divObj = document.getElementById(divid);

    divObj.style.visibility = "visible";

}

function noticeHide(divid) {

    var divObj = document.getElementById(divid);

    divObj.style.visibility = "hidden";

}

function noticeClose(divid, closday)

{

    noticeHide(divid);

    SetNoticeCookie(divid, closday);

}

function closeWin() { 

document.getElementById('poplayer_No').style.visibility = "hidden";

} 

if (getNoticeCookie('poplayer_No') != "No") {

     noticeShow('poplayer_No'); 

}

</script>

</body>



  1. 'setTimeout', 타이머를 사용하자!

  2. No Image 09Sep
    by
    2016/09/09 Views 7075 

    특정 HTML DOM 엘레멘트로 스크롤 이동하기

  3. No Image 22Dec
    by
    2016/12/22 Views 7114 

    접근성 윈도우 팝업 띄우기

  4. No Image 21Sep
    by
    2016/09/21 Views 7134 

    연관배열 사용하기

  5. No Image 01Sep
    by 조쉬
    2016/09/01 Views 7166 

    이동 가능한 레이어팝업 소스

  6. No Image 27Feb
    by
    2014/02/27 Views 7185 

    지금 보고 있는 웹페이지 창을 닫으려고 합니다." 안나타나게 하기

  7. No Image 01Sep
    by
    2016/09/01 Views 7277 

    jquery offset()을 이용한 부드러운 스크롤 이동

  8. 창에 대한 정보얻기 (창 크기, 창 위치)

  9. 'opener', 부모창과 자식창의 텍스트를 교환하자!

  10. 'blur', 이미지 클릭시 테두리를 없애자!

  11. No Image 22Dec
    by
    2016/12/22 Views 7359 

    response.setHeader

  12. No Image 01Mar
    by
    2014/03/01 Views 7420 

    [jQuery] textarea 글자수 카운트

  13. No Image 01Mar
    by
    2014/03/01 Views 7458 

    체크박스 체크하면 레이어 보여주기. 체크안하면 알려주기

  14. 'checkbox', 체크박스 모두체크 그리고 모두해제!

  15. No Image 27Feb
    by
    2014/02/27 Views 7551 

    날짜 간의 일수 계산

  16. No Image 03Feb
    by
    2015/02/03 Views 7675 

    양력-음력

  17. [라디오버튼 오류 체크] 간단한 문제 예제

  18. No Image 19Jun
    by
    2015/06/19 Views 7876 

    정규식을 이용한 실시간 콤마(comma) 넣기

  19. No Image 22Dec
    by
    2016/12/22 Views 7914 

    복사방지+드래그금지+마우스우클릭 금지

  20. No Image 17Nov
    by
    2016/11/17 Views 7928 

    브라우저별 이미지 크기 변경

Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 Next
/ 13

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved