2017-09-05 41 views
2

我正在使用prestashop高級主題,它在滾動上有一個粘性菜單。在此菜單的頂部,我添加了另一個不粘的菜單模塊。我正在嘗試製作第二個菜單,但我不知道該如何粘貼。 我附上截圖以向你展示我的意思。 第一張圖片顯示兩個菜單,第二張圖片顯示菜單現在很粘。所以,我希望兩者都能夠在滾動時變得粘滯。prestashop中的粘性頂層菜單

完整的菜單:

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} 

我怎樣才能讓這個菜單很粘?非常感謝。

+0

你嘗試過使用'position:fixed;'在不粘的菜單上嗎? –

+0

是的,我嘗試過,但當我在頁面上滾動時,其他菜單保持在最前面。所以,即使我試圖使其固定仍在其他菜單下。 –

+0

這是預期的結果? https://jsfiddle.net/rezyc4bt/ –

回答

1

你需要修改兩個文件:2469

/themes/ps_glori/css/global.css

線,在#header > .nav,變化:position: relativeposition: fixed並添加:width: 100%

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

72號線,在.cs-sticky-fixed,更改top: 0top: 30px

+0

工作。非常感謝! :) –