레이어 팝업을 두개 뛰었는데요. 하루동안 뛰우기가 안됩니다. 정보
레이어 팝업을 두개 뛰었는데요. 하루동안 뛰우기가 안됩니다.본문
<!-- 레이어 팝업 자바스크립 -->
<script language="JavaScript1.2">
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");
whichDog=isIE ? document.all.theLayer1 : document.getElementById("theLayer1");
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 hideMe(){
if (isIE||isNN) whichDog.style.visibility="hidden";
else if (isN4) document.theLayer1.visibility="hide";
}
function showMe(){
if (isIE||isNN) whichDog.style.visibility="visible";
else if (isN4) document.theLayer.visibility="show";
}
function showMe(){
if (isIE||isNN) whichDog.style.visibility="visible";
else if (isN4) document.theLayer1.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;
}
function notice_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 "";
}
</script>
</head>
<script type="text/javascript" src="/viscon/js/dot.js"></script>
<body>
<!-- 밖 bg들어가는곳 -->
<!-- 레이어 팝업1 -->
<div id="theLayer" style="position:absolute; width:580px; visibility:visible; left:335px; top: 100px; display:none;">
<table border="0" width="250" bgcolor="#0b6dc9" cellspacing="0" cellpadding="5">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<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"> <font face="Arial" color="#FFFFFF">(주) 비스컨애드 공지</font> </layer></ilayer></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:10px" colspan="2"><img src="img/popup/pop200809.jpg" width="580" height="350" border="0"></td>
</tr>
<tr>
<td align=right><INPUT TYPE="checkbox" NAME="popupCookie" onclick="notice_setCookie('popup','done',1);hideMe();">
<FONT COLOR="#FFFFFF">하루동안 이창 보이지 않기</FONT></td>
<td style="cursor:hand" width="30" align="right"><a href="#" onClick="hideMe();return false">X</font></a> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<!-- 레이어 팝업 끝 -->
<!-- 레이어 팝업2 -->
<div id="theLayer1" style="position:absolute; width:300px; visibility:visible; left:20x; top: 100px; display:none;">
<table border="0" width="250" bgcolor="#c70948" cellspacing="0" cellpadding="5">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<td id="titleBar" style="cursor:move" width="100%"><ilayer width="100%" onSelectStart="return false"> <layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer1)" onMouseout="isHot=false"> <font face="Arial" color="#FFFFFF">(주) 비스컨애드 공지</font> </layer></ilayer></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:10px" colspan="2"><img src="img/popup/pop2008092.jpg" width="300" height="350" border="0"></td>
</tr>
<tr>
<td align=right><INPUT TYPE="checkbox" NAME="popupCookie" onclick="notice_setCookie('popup','done',1);hideMe();">
<FONT COLOR="#FFFFFF">하루동안 이창 보이지 않기</FONT></td>
<td style="cursor:hand" width="30" align="right"><a href="#" onClick="hideMe();return false">X</font></a> </td>
</tr>
</table></td>
</tr>
</table>
</div>
</div>
<!-- 레이어 팝업 쿠키 스크립-->
<script type="text/javascript">
if(notice_getCookie("popup") != "done") theLayer.style.display="block";
if(notice_getCookie("popup") != "done") theLayer1.style.display="block";
</script>
위의 내용이구요.
원래는 theLayer 만 있었던 스크립트에
theLayer1 을 추가한후 적용한 것입니다.
그런데 안되네요.... 아무래도 제가 추가를 잘못한듯 한데요.
좋은 방법이 없을까요?
답변 부탁드립니다. (__) 감사합니다.
<script language="JavaScript1.2">
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");
whichDog=isIE ? document.all.theLayer1 : document.getElementById("theLayer1");
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 hideMe(){
if (isIE||isNN) whichDog.style.visibility="hidden";
else if (isN4) document.theLayer1.visibility="hide";
}
function showMe(){
if (isIE||isNN) whichDog.style.visibility="visible";
else if (isN4) document.theLayer.visibility="show";
}
function showMe(){
if (isIE||isNN) whichDog.style.visibility="visible";
else if (isN4) document.theLayer1.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;
}
function notice_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 "";
}
</script>
</head>
<script type="text/javascript" src="/viscon/js/dot.js"></script>
<body>
<!-- 밖 bg들어가는곳 -->
<!-- 레이어 팝업1 -->
<div id="theLayer" style="position:absolute; width:580px; visibility:visible; left:335px; top: 100px; display:none;">
<table border="0" width="250" bgcolor="#0b6dc9" cellspacing="0" cellpadding="5">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<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"> <font face="Arial" color="#FFFFFF">(주) 비스컨애드 공지</font> </layer></ilayer></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:10px" colspan="2"><img src="img/popup/pop200809.jpg" width="580" height="350" border="0"></td>
</tr>
<tr>
<td align=right><INPUT TYPE="checkbox" NAME="popupCookie" onclick="notice_setCookie('popup','done',1);hideMe();">
<FONT COLOR="#FFFFFF">하루동안 이창 보이지 않기</FONT></td>
<td style="cursor:hand" width="30" align="right"><a href="#" onClick="hideMe();return false">X</font></a> </td>
</tr>
</table></td>
</tr>
</table>
</div>
<!-- 레이어 팝업 끝 -->
<!-- 레이어 팝업2 -->
<div id="theLayer1" style="position:absolute; width:300px; visibility:visible; left:20x; top: 100px; display:none;">
<table border="0" width="250" bgcolor="#c70948" cellspacing="0" cellpadding="5">
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0" height="36">
<tr>
<td id="titleBar" style="cursor:move" width="100%"><ilayer width="100%" onSelectStart="return false"> <layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer1)" onMouseout="isHot=false"> <font face="Arial" color="#FFFFFF">(주) 비스컨애드 공지</font> </layer></ilayer></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFF" style="padding:10px" colspan="2"><img src="img/popup/pop2008092.jpg" width="300" height="350" border="0"></td>
</tr>
<tr>
<td align=right><INPUT TYPE="checkbox" NAME="popupCookie" onclick="notice_setCookie('popup','done',1);hideMe();">
<FONT COLOR="#FFFFFF">하루동안 이창 보이지 않기</FONT></td>
<td style="cursor:hand" width="30" align="right"><a href="#" onClick="hideMe();return false">X</font></a> </td>
</tr>
</table></td>
</tr>
</table>
</div>
</div>
<!-- 레이어 팝업 쿠키 스크립-->
<script type="text/javascript">
if(notice_getCookie("popup") != "done") theLayer.style.display="block";
if(notice_getCookie("popup") != "done") theLayer1.style.display="block";
</script>
위의 내용이구요.
원래는 theLayer 만 있었던 스크립트에
theLayer1 을 추가한후 적용한 것입니다.
그런데 안되네요.... 아무래도 제가 추가를 잘못한듯 한데요.
좋은 방법이 없을까요?
답변 부탁드립니다. (__) 감사합니다.
댓글 전체
하루동안 뛰우지 않게 하고 싶습니다. 어디가 잘못됫을까요? 부탁드려요.
레이어 아이디가 두개이니
클릭 이벤트할때 함수(레이어 아이디) 로 하셔야 할듯하네요
클릭 이벤트할때 함수(레이어 아이디) 로 하셔야 할듯하네요