[쇼핑몰] 다중 레이어 팝업창 > 팁앤테크

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

팁앤테크

[쇼핑몰] 다중 레이어 팝업창

페이지 정보

본문

index.php 아래

<?
include "$g4[shop_path]/newwin1.inc.php"; // 새창띄우기

include_once("$g4[path]/tail.php");
?>

 

newwin1.inc.php의 내용

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

include_once("./_common.php");
?>

<script language="Javascript1.2">
<!--
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
 topDog=isIE ? "BODY" : "HTML";
 hotDog=isIE ? event.srcElement : e.target;
 idx=hotDog.id.substr(hotDog.id.length-1,1);
 whichDog=isIE ? eval("document.all.divpop"+idx) : document.getElementById("divpop" + idx);
 wD = eval("document.all.divpop"+idx);
 while (hotDog.id!=hotDog.id&&hotDog.tagName!=topDog){
   hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
 }

   //if (hotDog.id){
 if (hotDog.id==("titleBar"+idx)){
     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(id){
 if ( document.getElementById('chkbox'+id).checked ) {
     setCookie( "mainPop"+id, "done" , 1 );
   document.getElementById('chkbox'+id).checked = false;
   }

   if (isIE||isNN) document.getElementById('divpop'+id).style.visibility="hidden";
   else if (isN4) document.divpop.visibility="hide";
}

function setCookie( name, value, expiredays ) {
 var todayDate = new Date();
 todayDate.setDate( todayDate.getDate() + expiredays );
 document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");
//-->
</script>

<style type="text/css">
<!--
td {
  font-family: Tahoma, 돋움, Dotum, sans-serif;
  font-size: 11px;
  line-height: 145%;
  color: #000000;
}
//-->
</style>

<?
$sql = " select * from $g4[yc4_new_win_table]
   where '$g4[time_ymdhis]' between nw_begin_time and nw_end_time
   order by nw_id asc ";
$result = sql_query($sql);
for ($i=0; $row_nw=sql_fetch_array($result); $i++) {

$j = $i + 1;
$row_nw[nw_subject] = get_text($row_nw[nw_subject]);
$row_nw[nw_content] = conv_content($row_nw[nw_content], 1);
?>

<div id="divpop<?=$i?>" style="position:absolute;width:<?=($row_nw[nw_width]+12)?>px;left:<?=$row_nw[nw_left]?>;top:<?=$row_nw[nw_top]?>;visibility:hidden;z-index:<?=$j?>">
<table border="0" width="<?=($row_nw[nw_width]+12)?>" bgcolor="#9f9f9f" cellspacing="0" cellpadding="1">
<tr><td width="100%">
 <table border="0" width="<?=($row_nw[nw_width]+10)?>" cellspacing="0" cellpadding="0" height="<?=($row_nw[nw_height]+50)?>">
    <tr height="20">
    <td width="<?=$row_nw[nw_width]?>" id="titleBar<?=$i?>" style="cursor:move">
    <ilayer width="100%" onSelectStart="return false">
    <layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(divpop<?=$i?>)" onMouseout="isHot=false">
    <font face="Arial" color="#FFFFFF">&nbsp;<?=$row_nw[nw_subject]?></font>
    </layer>
    </ilayer>
    </td>
    <td width="10" style="cursor:hand" align="right" valign="top"><a href="#" onClick="hideMe(<?=$i?>);return false"><font color=#ffffff size=2 face=arial style="text-decoration:none">X</font></a>&nbsp;</td>
    </tr>
    <tr><td colspan="2" bgcolor="#FFFFFF" style="padding:5px" valign="top">
    <?=conv_content($row_nw[nw_content], $row_nw[nw_content_html]);?>
    </td></tr>
   <tr><td colspan="2" height="20" bgcolor="#EFEFEF" align="right">
   <input type="checkbox" name="chkbox<?=$i?>" id="chkbox<?=$i?>" value="checkbox" onfocus="this.blur();" onclick="hideMe(<?=$i?>);"> 하루 동안 이 창을 열지 않습니다. &nbsp;
   </td></tr>
    </table>
</td></tr>
</table>
</div>

<?
}
?>

<script language="Javascript">
<!--
cookiedata = document.cookie;
for (j=0;j<<?=$i?>;j++){
 if ( cookiedata.indexOf("mainPop"+j+"=done") < 0 ) {
     document.all['divpop'+j].style.visibility = "visible";
  }
  else {
   document.all['divpop'+j].style.visibility = "hidden";
  }
}
//-->
</script>

추천0

댓글목록

등록된 댓글이 없습니다.

Total 29건 1 페이지
  • RSS
팁앤테크 목록
번호 제목 글쓴이 조회 추천 날짜
29 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14285 0 11-17
28 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14430 0 04-26
27 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 25844 0 01-23
26 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 30806 1 05-30
25 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 24889 0 05-25
24 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17289 0 03-02
23 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 18539 0 01-05
22 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17355 0 01-05
21 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16620 0 01-05
20 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15965 0 11-09
19 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 18857 0 01-28
18 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16945 0 01-20
17 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12911 0 11-06
16 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14995 0 06-27
15 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16229 0 06-27
14 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13258 0 06-15
13 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15029 0 06-15
12 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12777 0 06-11
11 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12001 0 04-30
10 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17717 0 04-28
9 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12633 0 04-27
열람중 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13339 0 04-25
7 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 10791 0 04-24
6 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12017 0 04-24
5 제로쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 10630 0 04-24

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
2,866
어제
4,901
최대
7,259
전체
1,233,796
Copyright (c) 株式会社YHPLUS. All rights reserved.