我是按照管理员那个教程写的外循环和内循环,呵呵,就是直接复制上的,我不懂SQL,循环体稍微有点改动,主导航是出来了,不过多了一个百货商品栏目不知道从哪里出来的,我没建这个栏目啊,2级栏目老是显示不出来,我静态的css样式测试没问题,是不是sql语句有问题,能帮我看下吗?
select top 50 ID,foldername from KS_Class where tn='{$Param(0)}' order by folderorder
[loop=50]
<li><a href="{$Field(ID,GetInfoUrl,100,1)}">{$Field(foldername,Text,0,...,0,)}</a></li>
[/loop]
这是{SQL_尖峰导航内循环}
select ID,FolderName from KS_Class where tn='0' order by folderorder[loop=10]
<li>
<a href="{$Field(ID,GetInfoUrl,100,1)}">{$Field(FolderName,Text,0,...,0,)}</a> |
<ul>
{SQL_尖峰导航内循环({$Field(ID,GetInfoUrl,100,2)})}
</ul>
</li>
[/loop]
{SQL_尖峰导航外循环}
————————————————
这是脚本
<script>
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=startList;
</script>
这是css样式
.menu_a{ width:980px; height:33px; position:relative; display:block;}
.menu_a li{
margin-left:3px;
display:block;
float: left;
width:90px;
font-size:14px;
font-weight:bold;
height:33px;
line-height:33px;
text-align: center;
cursor:pointer;
}
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
.menu_a li ul{ position: absolute;
left:-500px; /* Set 1px less than menu width */
top: 30px;
display: none; }
.menu_a li ul li{width:80px;font-size:12px; font-weight: normal; margin-left:20px; height:30px; line-height:40px; display:inline; }
.menu_a li:hover ul, li.over ul { display: block; }
-------------------------------
这是调用样式<ul class="menu_a" id="nav">{SQL_尖峰导航外循环()} </ul>