심플한 레이어 팝업 공지 > script

본문 바로가기
사이트 내 전체검색

script

심플한 레이어 팝업 공지

페이지 정보

작성자 서방님 댓글 0건 조회 275회 작성일 07-10-16 17:55

본문

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script>
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer"); 
  hotDog=isIE ? event.srcElement : e.target; 
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  } 
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false; 
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

function notice_setCookie( name, value, expiredays )
{
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + '=' + escape( value ) + '; path=/; expires=' + todayDate.toGMTString() + ';'
 return;
}
</script>
<body>

<div id="theLayer" style="position:absolute;width:250px; visibility:visible; left:100px; top: 100px; display:block;">
<table width="460" height="307" border=0 bgcolor="#DDDDDD">
<tr  height="15">
  <td id="titleBar" style="cursor:move" width="100%">
  <ilayer width="100%" onSelectStart="return false">
  <layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer)" onMouseout="isHot=false">
  타이틀 제목
  </layer>
  </ilayer>
  </td>
  <td style="cursor:hand" valign="top">
  <a href="#" onClick="hideMe();return false"><font color=#ffffff size=2 face=arial  style="text-decoration:none">닫기</font></a>
  </td>
  </tr>
<tr height="254">
<td>
콘텐츠 내용
</td>
</tr>
<tr>
<td>
<INPUT TYPE="checkbox" NAME="popupCookie" onclick="notice_setCookie('popup','done',1);hideMe();">
<!-- 스크립트에서 popup 쿠키가 있는지 없는지 확인해서 Layer의 display부분을 block 또는 none로 결정한다 -->
하루 동안 이 팝업을 보이지 않음.
</td>
</tr>
</table>
</div>
테스트
</body>
</html>

댓글목록

등록된 댓글이 없습니다.

Total 846건 25 페이지
게시물 검색

회원로그인

접속자집계

오늘
579
어제
506
최대
1,347
전체
173,110
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.