ECShop 网上商店系统支持论坛's Archiver

huchaopeng 发表于 2008-9-18 15:39

这种商品分类导航是怎么做的能不能给点思路?

[url=http://eshopping.ganso.com.cn/Product/Prodetail.aspx?bc=96&prodid=746&moduleid=1]http://eshopping.ganso.com.cn/Product/Prodetail.aspx?bc=96&prodid=746&moduleid=1[/url]



研究了好几天

也知道难点在哪

本来这种效果就是用JS代码做的
难点就在于不管是左边还是右边  的显示的那些字和连接都不是固定的,随着后台和数据库的修改而让文字变化


个有牛人给我点思路


做出来我共享...

yizhimei 发表于 2008-9-18 16:20

<div id="cat-div" style="padding:5px 10px;">
  <ul>
    <!--{foreach from=$categories item=cat}-->
    <li> <span class="parent-cat"><A href="{$cat.url}">{$cat.name|escape:html}</A></span><br />
      <!--{foreach from=$cat.children item=child}-->
      <span style="white-space:nowrap;"><A href="{$child.url}">{$child.name|escape:html}</A></span>
      <!--{/foreach}-->
    </li>
    <!--{/foreach}-->
  </ul>
</div>

这段就是分类导航的代码 {$cat.name|escape:html}就是大分类{$child.name|escape:html}是这个大分类下边的小分类

huchaopeng 发表于 2008-9-18 17:12

你说的这些代码是category_tree.lbi
这文件里的吧

JS代码是在这文件里添加是吗?

huchaopeng 发表于 2008-9-18 17:21

我知道


<script language="javascript">
// JavaScript Document

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>

这是JS的那功能大代码应该怎么在category_tree.lbi里添加呢?

sonyr 发表于 2008-9-18 17:50

直接放到第2行或最后就行了!

winask 发表于 2008-9-18 17:59

顶..:lol

kxgow 发表于 2008-9-18 19:51

:P :P 不错!

huchaopeng 发表于 2008-9-19 08:03

到底该怎么改呢??

huchaopeng 发表于 2008-9-19 09:05

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript">
// JavaScript Document

startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("cat-div");
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>
<body>
<ul id="cat-div">  
<li><a href="{$cat.url}">{$cat.name|escape:html}</a></li>   
<ul>   
<li><a href="{$child.url}">{$child.name|escape:html}</a></li>  
</ul>  
</li>
</ul>  
</body>




我这么改了下想用这个JS效果  怎么只显示最后一个商品分类的了别的都没了怎么解决???

lswl8 发表于 2008-11-24 18:34

:lol :lol :lol :lol :lol :lol

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.