以下这个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>
<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>
<script language="javascript" for="window" event="onload">
menu(categorieslist1);
</script>function menu(oblog){
oblog.style.display='';
}
ul.tree, ul.tree ul{ list-style-type:none; display:block; }
刷新页面,全部展开,刷新完成后,又自动全部缩回去了!
模板: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}