以下这个Tree是合起来的,怎么让它默认为全部展开呢?
<ul class="tree {if $blockcategories.isDhtml}dhtml{/if}">
{foreach from=$blockcategories.blockCategTree.children item=child name=blockCategTree}
{if $smarty.foreach.blockCategTree.last}
                        {include file=$blockcategories.branche_tpl_path node=$child last='true'}
{else}
{include file=$blockcategories.branche_tpl_path node=$child}
{/if}
{/foreach}
</ul>

解决方案 »

  1.   

    这个跟php代码是没有关系的 在你的css里面设置了
      

  2.   

    等待高手回答  CSS里面怎么设置呢?
      

  3.   

    网上有很多代码,但是感觉CSS代码太多太乱,我只要简单地全部展开
      

  4.   

    晕,这样也不行!
    <script language="javascript" for="window" event="onload"> 
      menu(categorieslist1);
    </script>function menu(oblog){
    oblog.style.display='';
    }
      

  5.   

    这样也不行哦:
    ul.tree, ul.tree ul{ list-style-type:none; display:block; }
    刷新页面,全部展开,刷新完成后,又自动全部缩回去了!
      

  6.   


    模板:blockcategories.tpl,也就是css class:"tree" 和 “dhtml”在控制啊!
    “dhtml”的CSS代码:div#categories_block_left ul.dhtml{ display:none; }已经被我注释掉了,
    现在只有"tree"在控制啊,那我12楼那样写怎么还不行呢?
    {if $blockcategories.active}
    <script type="text/javascript" src="{$js_dir}tools/treeManagement.js"></script>
    <!--  -->
    <div id="categories_block_left" class="qblock">    <h4>{$blockcategories.catgri}</h4> <div class="block_content">
    <ul class="tree {if $blockcategories.isDhtml}dhtml{/if}">
    {foreach from=$blockcategories.blockCategTree.children item=child name=blockCategTree}
    {if $smarty.foreach.blockCategTree.last}
                            {include file=$blockcategories.branche_tpl_path node=$child last='true'}
    {else}
    {include file=$blockcategories.branche_tpl_path node=$child}
    {/if}
    {/foreach}
    </ul>
    </div>
    </div>
    <!-- / -->
    {/if}
      

  7.   

    你只考虑了 css 的影响,但开合是由 js 控制的