제가 질문을 잘 못햇네요..
소스를 보니 중분류와 소분류에서 구현이 되어야되는대^^""
소스를 같이 올려볼게요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//
// 2단계 분류 레이어 표시
//
$menu = ""; // 메뉴 레이어 임시저장 변수 (처음엔 아무값도 없어야 합니다.)
$sub_menu_left = 100; // 2단계 메뉴 왼쪽 좌표 (1단계 좌표에서 부터)
?>
<table bgcolor=#FFFFFF width=100% cellpadding=0 cellspacing=0>
<?
// 1단계 분류 판매가능한것만
$hsql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
and ca_id not in ('20')
order by ca_id ";
$hresult = sql_query($hsql);
$hnum = @mysql_num_rows($hresult);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
// 2단계 분류
$menubody = "";
$onmouseover = "";
$onmouseout = "";
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '4'
and SUBSTRING(ca_id,1,2) = '$row[ca_id]'
and ca_use = '1'
order by ca_id ";
$result2 = sql_query($sql2);
$hnum2 = @mysql_num_rows($hresult);
for ($j=0; $row2=sql_fetch_array($result2); $j++)
{
$menubody3 = "";
///////////////////////////////////////////////////////////////// 3단계 분류
$sql3 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '6'
and SUBSTRING(ca_id,1,4) = '$row2[ca_id]'
and ca_use = '1'
order by ca_id ";
$result3 = sql_query($sql3);
$hnum3 = @mysql_num_rows($result3);
$depth3="";
for ($y=0; $row3=sql_fetch_array($result3); $y++) {///
$menubody3 .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row3[ca_id]'>$row3[ca_name]</a></td></tr>";
}///
if ($menubody3){
$depth3="
<div id='lmenu_layer{$row2[ca_id]}{$j}' style='width:180px; display:none; position:absolute; z-index:999;'>
<table cellpadding=1 cellspacing=0 bgcolor=#CCCCCC width=100%><tr><td>
<table border=0 width=100% bgcolor=#FFFFFF cellpadding=0 cellspacing=0>".$menubody3."</table>
</td></tr></table>
</div>";
}
/////////////////////////////////////////////////////////////////// 3단계 분류끝
if ($menubody3)
{
$onmouseover = " layer_view('lmenu{$row2[ca_id]}{$j}', 'lmenu_layer{$row2[ca_id]}{$j}', 'view', $sub_menu_left, -22); ";
$onmouseout = " layer_view('lmenu{$row2[ca_id]}{$j}', 'lmenu_layer{$row2[ca_id]}{$j}', 'hide'); ";
}
$menubody .="<tr id='lmenu{$row2[ca_id]}{$j}' onmouseover=\"$onmouseover\" onmouseout=\"$onmouseout\">";
$menubody .= "<td height='22'> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'<font style='font-size:12;font-weight:bold;'>$row2[ca_name]</font></a>{$depth3}</td></tr>";
$menubody .= "<tr><td align=center><img src='$g4[shop_img_path]/dot_line.gif'></td></tr>\n";
}
$category_link = "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>";
echo "<tr>";
echo "</td></tr>\n";
if ($i<$hnum-1) // 맨밑줄은 출력하지 않음
echo $menubody."\n";
}
if ($i==0)
echo "<tr><td height=50 align=center>등록된 자료가 없습니다.</td></tr>\n";
?>
</table>
<?=$menu?>
<script language="JavaScript">
var save_layer = null;
function layer_view(link_id, menu_id, opt, x, y)
{
var link = document.getElementById(link_id);
var menu = document.getElementById(menu_id);
//for (i in link) { document.write(i + '<br/>'); } return;
if (save_layer != null)
save_layer.style.display = "none";
if (opt == 'hide')
{
menu.style.display = 'none';
}
else
{
x = parseInt(x);
y = parseInt(y);
menu.style.left = get_left_pos(link) + x;
menu.style.top = get_top_pos(link) + link.offsetHeight + y;
menu.style.display = 'block';
}
save_layer = menu;
}
</script>
>
>
> 분류표시를 위 그림처럼 구현하고 싶습니다.
>
> 중분류를 오버시 소분류가 레이어로 나오는게 아니라 분류에서 펼처진 상태로 보여졌으면 합니다.
> 나머지 중분류는 레이어로 나오고요.
>
> 어디를 수정해야 하는지요.
>
> 부탁드립니다.
>
> 수고하세요^^
>
>
>
> 참고 주소는
> http://www.10x10.co.kr/shopping/category_list.asp?cdl=035&cdm=011
>
소스를 보니 중분류와 소분류에서 구현이 되어야되는대^^""
소스를 같이 올려볼게요.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//
// 2단계 분류 레이어 표시
//
$menu = ""; // 메뉴 레이어 임시저장 변수 (처음엔 아무값도 없어야 합니다.)
$sub_menu_left = 100; // 2단계 메뉴 왼쪽 좌표 (1단계 좌표에서 부터)
?>
<table bgcolor=#FFFFFF width=100% cellpadding=0 cellspacing=0>
<?
// 1단계 분류 판매가능한것만
$hsql = " select ca_id, ca_name from $g4[yc4_category_table]
where length(ca_id) = '2'
and ca_use = '1'
and ca_id not in ('20')
order by ca_id ";
$hresult = sql_query($hsql);
$hnum = @mysql_num_rows($hresult);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
// 2단계 분류
$menubody = "";
$onmouseover = "";
$onmouseout = "";
$sql2 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '4'
and SUBSTRING(ca_id,1,2) = '$row[ca_id]'
and ca_use = '1'
order by ca_id ";
$result2 = sql_query($sql2);
$hnum2 = @mysql_num_rows($hresult);
for ($j=0; $row2=sql_fetch_array($result2); $j++)
{
$menubody3 = "";
///////////////////////////////////////////////////////////////// 3단계 분류
$sql3 = " select ca_id, ca_name from $g4[yc4_category_table]
where LENGTH(ca_id) = '6'
and SUBSTRING(ca_id,1,4) = '$row2[ca_id]'
and ca_use = '1'
order by ca_id ";
$result3 = sql_query($sql3);
$hnum3 = @mysql_num_rows($result3);
$depth3="";
for ($y=0; $row3=sql_fetch_array($result3); $y++) {///
$menubody3 .= "<tr height='22'><td> · <a href='$g4[shop_path]/list.php?ca_id=$row3[ca_id]'>$row3[ca_name]</a></td></tr>";
}///
if ($menubody3){
$depth3="
<div id='lmenu_layer{$row2[ca_id]}{$j}' style='width:180px; display:none; position:absolute; z-index:999;'>
<table cellpadding=1 cellspacing=0 bgcolor=#CCCCCC width=100%><tr><td>
<table border=0 width=100% bgcolor=#FFFFFF cellpadding=0 cellspacing=0>".$menubody3."</table>
</td></tr></table>
</div>";
}
/////////////////////////////////////////////////////////////////// 3단계 분류끝
if ($menubody3)
{
$onmouseover = " layer_view('lmenu{$row2[ca_id]}{$j}', 'lmenu_layer{$row2[ca_id]}{$j}', 'view', $sub_menu_left, -22); ";
$onmouseout = " layer_view('lmenu{$row2[ca_id]}{$j}', 'lmenu_layer{$row2[ca_id]}{$j}', 'hide'); ";
}
$menubody .="<tr id='lmenu{$row2[ca_id]}{$j}' onmouseover=\"$onmouseover\" onmouseout=\"$onmouseout\">";
$menubody .= "<td height='22'> · <a href='$g4[shop_path]/list.php?ca_id=$row2[ca_id]'<font style='font-size:12;font-weight:bold;'>$row2[ca_name]</font></a>{$depth3}</td></tr>";
$menubody .= "<tr><td align=center><img src='$g4[shop_img_path]/dot_line.gif'></td></tr>\n";
}
$category_link = "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>";
echo "<tr>";
echo "</td></tr>\n";
if ($i<$hnum-1) // 맨밑줄은 출력하지 않음
echo $menubody."\n";
}
if ($i==0)
echo "<tr><td height=50 align=center>등록된 자료가 없습니다.</td></tr>\n";
?>
</table>
<?=$menu?>
<script language="JavaScript">
var save_layer = null;
function layer_view(link_id, menu_id, opt, x, y)
{
var link = document.getElementById(link_id);
var menu = document.getElementById(menu_id);
//for (i in link) { document.write(i + '<br/>'); } return;
if (save_layer != null)
save_layer.style.display = "none";
if (opt == 'hide')
{
menu.style.display = 'none';
}
else
{
x = parseInt(x);
y = parseInt(y);
menu.style.left = get_left_pos(link) + x;
menu.style.top = get_top_pos(link) + link.offsetHeight + y;
menu.style.display = 'block';
}
save_layer = menu;
}
</script>
>
>
> 분류표시를 위 그림처럼 구현하고 싶습니다.
>
> 중분류를 오버시 소분류가 레이어로 나오는게 아니라 분류에서 펼처진 상태로 보여졌으면 합니다.
> 나머지 중분류는 레이어로 나오고요.
>
> 어디를 수정해야 하는지요.
>
> 부탁드립니다.
>
> 수고하세요^^
>
>
>
> 참고 주소는
> http://www.10x10.co.kr/shopping/category_list.asp?cdl=035&cdm=011
>
첨부파일
댓글 1개
게시글 목록
| 번호 | 제목 |
|---|---|
| 56073 | |
| 56067 | |
| 56065 | |
| 56060 | |
| 56058 | |
| 56055 | |
| 56051 | |
| 56048 | |
| 56044 | |
| 56043 | |
| 56042 | |
| 56039 | |
| 56035 | |
| 56032 | |
| 56030 | |
| 56028 | |
| 56025 | |
| 56018 | |
| 56012 | |
| 56010 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기