Eyoucms手風琴三級菜單,掌握三級分類用法
2022-11-24 加入收藏
應用:適用于左右結構排版三級產品分類或文章分類。
1、效果圖

2、HTMl
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <!-- 分類折疊手風琴菜單 開始 --><divclass="subnavbox bg-white radius"><h2class="bg-blue text-white">{eyou:channelartlist typeid='$eyou.field.typeid|gettoptype=###,typeid'}{eyou:field name='typename' /}{/eyou:channelartlist}</h2><!--當前欄目下二級欄目調用-->{eyou:channel type="first" currentstyle="active"}     {eyou:eq name='$eyou.field.grade' value='2'}         {eyou:type typeid='$eyou.field.typeid' id='field1'}             {eyou:eq name='$field1.parent_id' value='$field.id'}                 {eyou:assign name='$field.currentstyle' value='current' /}                <!--current對應樣式中的display:block-->            {/eyou:eq}         {/eyou:type}     {/eyou:eq}    <divclass="{$field.currentstyle}dd {$field.currentstyle}dt suboneNav">{$field.typename}</div>    <!--當前欄目下三級欄目調用-->    {eyou:notempty name="$field.children"}    <ulclass="cur-bg {$field.currentstyle}">        {eyou:channel name="$field.children" id="field2"}        <li><ahref="{$field2.typeurl}"class="{$field2.currentstyle}">{$field2.typename}{$field2.typeid}</a>        </li>        {/eyou:channel}    </ul>    {/eyou:notempty} {/eyou:channel}</div><!-- 分類折疊手風琴菜單 結束 --> | 
3、CSS
| 1 2 3 4 5 6 7 8 9 10 | .subnavbox h2{line-height:60px;height:60px;position:relative;font-size:20px;padding:00020px;}.subnavbox .current {display:block;}.subnavbox .cur-bg{background:#fff;padding:10px0;}.subnavbox ul {display:none;}.subnavbox ul li a{display:block;line-height:36px;font-size:14px;color:#999;padding-left:20px;}.subnavbox ul li a:hover {color:#FF6D33;}.subnavbox ul li a.active {color:#FF6D33;}.suboneNav{border-bottom:solid1px#0BECF1;background:#0AD4D9url(../images/ico_jia.png) no-repeat;background-position:95%50%;cursor:pointer;font-size:16px;color:#fff;line-height:54px;padding-left:20px;}.suboneNav:last-child{border-bottom:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px} .currentdt {background-image:url(../images/ico_jian.png);} | 
4、JS
| 1 2 3 4 5 | $(".suboneNav").click(function() {    $(this).toggleClass("currentdd").siblings(".suboneNav").removeClass("currentdd");    $(this).toggleClass("currentdt").siblings(".suboneNav").removeClass("currentdt");    $(this).next("ul").slideToggle(300).siblings("ul").slideUp(500);}) | 
 
                                                     
                                                     
                                                     
                                                     
                                                     
                                                     
                                                     
                                                     
                                                    
