织梦做产品栏目的时候,会有一级栏目和二级栏目,一般都喜欢用折叠的效果!!但是点击进入的话,默认会关闭!怎么才能让它默认打开呢!织梦58提供了这方面的标签和js! 注意!这个只是一个实例,没有折叠效果的js效果!js自行网上查找!!
<script> $(document).ready(function () { openoff('#part2_{dede:field.id/}'); openoff('#part2_{dede:field.reid/}'); }) function openoff(obj){ $(obj).next("dd").css("display","block"); $(obj).addClass("launched"); } </script> <div class="menu" id="sidebar" data-csnow="2" data-class3="0" data-jsok="2"> {dede:channelartlist typeid=27} <dl class="list-none navnow"> <dt id='part2_{dede:field name="id"/}' ><a href='{dede:field name="typeurl"/}' title='{dede:field name="typename"/}' ><span>{dede:field name="typename"/}</span></a></dt> <dd class="sub" style="display:none;"> {dede:channel type='son' noself='yes'} <h4 id='part3_[field:id/]'><a href="[field:typedir function="str_replace('{cmspath}','',@me)"/]" title='[field:typename /]' class='nav'><span>[field:typename /]</span></a></h4> {/dede:channel} </dd> </dl> {/dede:channelartlist} <div class="clear"></div> </div> <Style type="text/css"> .launched{background-image:url(/skin/images/nav_hover.jpg);color: #d5b687;} .list-none{ list-style:none; padding:0px; margin:0px;} .menu dl{ margin-top:5px; } .menu dt{cursor: pointer;margin-top: 10px;font-weight: bold;font-size: 16px;font-family: "微软雅黑";color: #0d2180;line-height: 53px;padding-left: 48px; background: url(/skin/images/nav.jpg) no-repeat;} .menu h4 a{ display: block;width: 200px;height: 28px;font-family: "微软雅黑";text-align: center;font-size: 14px;line-height: 28px;color: #333; } .menu h4 span{ display: block;width: 200px;height: 28px; font-weight:100;font-family: "微软雅黑";text-align: center;font-size: 14px;line-height: 28px;color: #333; } .menu h4 a:hover{color: #fff;background-color: #d5b687;} </Style> |