商品类别导航(类别在后台可以添加)

js部分

<php>
 //这里的category_cid=0是一级目录
$sql2="select category_id,category_name from category  where category_cid='0'  order by category_rank";
$result2=@mysql_query($sql2);
$iii=0;
    while(($row2 = mysql_fetch_array($result2))) {
    $iii++;
    }
    
    </php>
<script language=javascript id=clientEventHandlersJS>
<!--
var number=<php>echo $iii;</php>;

function LMYC() {
var lbmc;
//var treePic;
    for (i=1;i<=number;i++) {
        lbmc = eval('LM' + i);
        //treePic = eval('treePic'+i);
        //treePic.src = 'tupian/images/file.gif';
        lbmc.style.display = 'none';
    }
}
 
function ShowFLT(i) {
    lbmc = eval('LM' + i);
    //treePic = eval('treePic' + i)
    if (lbmc.style.display == 'none') {
        LMYC();
        //treePic.src = 'tupian/images/nofile.gif';
        lbmc.style.display = '';
    }
    else {
        //treePic.src = 'tupian/images/file.gif';
        lbmc.style.display = 'none';
    }
}
//-->
</script>



body部分

<table width="222" height="250" border="0"  cellpadding="0" cellspacing="0">
  <tbody>

<!--中间部列表开始-->
    <tr>
      <td  valign="top" background="">
<!--中间表格开始-->
        <TABLE cellSpacing=0 cellPadding=0 width="88%" border=0>
        <TBODY>
   
    
        <php>
           <php>
           
$sql="select category_id,category_name from category  where category_cid='0' order by category_rank";
$result=@mysql_query($sql);
$ii=0;
    while(($row = mysql_fetch_array($result))) {
    
    $ii++;
    
        
        </php>
          <TR>
            <TD style="PADDING-LEFT: 20px" background="" height=30><IMG
                  height=13 src="__PUBLIC__/img/changping_09.jpg" width=13
                  align=absMiddle> <A οnclick=javascript:ShowFLT("<php>echo  $ii;</php>")
                  href="javascript:void(null)" class="aa"><php>echo $row['1'];</php></A> </TD>
                
          </TR>
          <TR id= "<php>echo  "LM".$ii;</php>" style="DISPLAY: none">
            <TD><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                    <php>

//在这儿category_cid只能等于与他对应的大类
$sql1="select category_id,category_name from category where category_cid=".$row[0]." order by category_rank";
$result1=mysql_query($sql1);
while(($row1 = mysql_fetch_array($result1))) {

    
    
                   </php>
                  <TR>
                    <TD style="PADDING-LEFT: 40px" height=23><!--<IMG height=7
                        src=" " width=8 align=absMiddle> --><A title=文件夹
                        href="__URL__/Product?cateid=<php>echo $row1['0'];</php>"
                        target=_parent><php>echo $row1['1'];</php></A> </TD>
                  </TR>
                  <TR>
                    <TD background="" height=3></TD>
                  </TR>
                <php>
                
                }
                
                </php>
                  
                </TBODY>
            </TABLE></TD>
          </TR>

          
          
          <php>
          
          
          }
          
          </php>
          
      
        </TBODY>
      </TABLE><!--中间表格结束--></td>
    </tr><!--中间列表结束-->
 
  </tbody>
</table>
          





  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值