聯系官方銷售客服
1835022288
028-61286886
<ul id="subnav">
{category module=share pid=1 return=t}
<li {if $t.id==$catid} class="hover"{/if}><a href="{$t.url}" title="{$t.name}">{$t.name}</a>
{if $t.child}
<dl>
{category module=share pid=$t.id return=t2}
<dt><a href="{$t2.url}" title="{$field2.typename}">{$t2.name}</a> </dt>
{/category}
</dl>
{/if}
</li>
{/category}
</ul>
怎么實現我點擊的一級欄目或者是一級欄目下的二級欄目,一級欄目的樣式是class="hover"。上面代碼這樣設置后只能是對應的一級欄目加了樣式,請教二級欄目點擊后一級欄目那里也加樣式需要怎么實現?
用這個吧
這里填寫參數就可以生成相關的代碼,每個參數后面都有用法解釋,category標簽的生成工具:http://www.zbshanke.com/doc/code/category.html