产品类表,结构是这样的
Field Type Collation Null Key
--------- ------------ --------------- ------ ------
c_id int(11) (NULL) NO PRI
c_pid int(11) (NULL) YES
c_path varchar(255) utf8_general_ci YES
c_name varchar(255) utf8_general_ci YES
这是我写的获取菜单的函数
- PHP code
function menuhead($pid=0) { global $mydb; $rs=$mydb->query("select c_id,c_pid,c_name from pdt_catagories where c_pid=".$pid.""); if ($rs->rnum()) { echo '<ul>'; while ($f=$rs->movenext()) { echo '<li class="'.(!$pid?"mout":"out").'">'; if (!$pid) echo '<a href="'.DIR_WS_ROOT.'cate.php?id='.$f["c_id"].'">'.$f["c_name"].'</a>'; else echo '<a href="'.DIR_WS_ROOT.'cate.php?id='.$f["c_id"].'">'.displaystr($f["c_name"],26).'</a>'; echo $pid?'<span>':'<div>'; menuhead($f["c_id"]); echo $pid?'</span>':'</div>'; echo '</li>'; } echo '</ul>'; } }
我想做成这样的,请问该怎么写啊,主要就是CSS样式不会
------解决方案--------------------
这个是js的 而且这个不需要数据可吧 类似导航菜单 你搜一下滑动菜单 网上多的是
------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>滑动门</title>
<style media="screen" type="text/css">
<!--
*{font-size:12px;}
html,body{margin:0;text-align:center;over-flow:hidden;height:100%;width:100%;}
UL{list-style-type:none; margin:0px;}
/* 标准盒模型 */
.ttl{height:18px;}
.ctt{height:auto;padding:6px;clear:both;border:1px solid #064ca1;border-top:0;text-align:left;}
.w936{margin:2px 0;clear:both;width:936px;/*滑动门的宽度*/}
/* TAB 切换效果 */
.tb_{background-image: url('http://www.codefans.net/jscss/demoimg/200901/tabs1.gif'); background-repeat: repeat-x;background-color: #E6F2FF;}
.tb_ ul{height:24px;}
.tb_ li{float:left;height: 24px;line-height:1.9;width: 94px;cursor:pointer;}
/* 控制显示与隐藏css类 */
.normaltab { background-image:url('http://www.codefans.net/jscss/demoimg/200901/tabs2.gif'); background-repeat: no-repeat; color:#1F3A87 ;}
.hovertab { background-image: url('http://www.codefans.net/jscss/demoimg/200901/tabs3.gif'); background-repeat: no-repeat; color:#1F3A87; font-weight:bold }
.dis{display:block;}
.undis{display:none;}
-->
</style>
<script type="text/javascript" language="javascript">
//<!CDATA[
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=1;i<=6;i++){g('tb_'+i).className='normaltab';g('tbc_0'+i).className='undis';}g('tbc_0'+n).className='dis';g('tb_'+n).className='hovertab';
}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
//]]>
</script>
</head>
<body>
<div class="w936">
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);">
ASP.NET</li>
<li id="tb_2" class="normaltab" onmouseover="i:HoverLi(2);">