代码之家  ›  专栏  ›  技术社区  ›  C. Andreea

prestashop中的粘性顶部菜单

  •  2
  • C. Andreea  · 技术社区  · 8 年前

    我正在使用一个prestashop premium主题,它在卷轴上有一个粘性菜单。在这个菜单的顶部,我为一个不粘的菜单添加了另一个模块。我正在努力使我添加的第二份菜单变得有粘性,但我不知道怎么做。

    完整菜单:

    enter image description here

    当前粘性菜单 enter image description here

    {if $MENU != ''}
        <!-- Menu -->
        <div id="block_top_menu" class="sf-contener clearfix col-lg-12">
            <div class="cat-title">{l s="Categories" mod="blocktopmenu"}</div>
            <ul class="sf-menu clearfix menu-content">
                {$MENU}
                {if $MENU_SEARCH}
                    <li class="sf-search noBack" style="float:right">
                        <form id="searchbox" action="{$link->getPageLink('search')|escape:'html':'UTF-8'}" method="get">
                            <p>
                                <input type="hidden" name="controller" value="search" />
                                <input type="hidden" value="position" name="orderby"/>
                                <input type="hidden" value="desc" name="orderway"/>
                                <input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|escape:'html':'UTF-8'}{/if}" />
                            </p>
                        </form>
                    </li>
                {/if}
            </ul>
        </div>
        <!--/ Menu -->
    {/if}
    

    我怎样才能把菜单弄粘?谢谢。

    1 回复  |  直到 8 年前
        1
  •  1
  •   idnovate    8 年前

    您需要编辑2个文件:

    /themes/ps_glori/css/global.css

    第2469行 #header > .nav ,更改: position: relative position: fixed 并添加: width: 100%

    /themes/ps_glori/css/modules/csmanagement/css/codespot-global.css

    第72行 .cs-sticky-fixed 改变 top: 0 具有 top: 30px