superfish + slicknav不起作用

时间:2015-06-16 16:36:16

标签: javascript jquery html css slicknav

我在网站菜单上有问题,此菜单有更多部分,桌面版本为suddivise两部分,第一部分为普通菜单,第二部分使用jquery superfish进行下拉菜单在桌面上。

在移动设备中仅使用slicknav,http://slicknav.com/

每个工作都很好,但有问题,如果示例打开桌面菜单并尝试调整桌面屏幕superfish不用slicknav切换,只有重新加载页面工作和加载正确的类。

反之亦然:

如果在慢速屏幕中打开菜单并在尝试打开后切换到superfish

在实践中应将类更改为同一<div class="">以在桌面superfish中使用,并在移动中使用slicknav

ii已使用此脚本但无法正常工作

<script>

function resize() {
if ( $(window).width() < 739) { 
$("#nullo").toggleClass('sf-menu cambioclasse2');
}
else {
$("#nullo").toggleClass('sf-menu sf-menu');
}
}
$(window).on("resize", resize);
resize(); // call once initially

</script>

我用过的class="cambioclasse2 "课程取消了superfish "sf-menu"

的课程

桌面菜单:

<div id="header" class="clearfix">
    <ul id="top-menu">

    <ul id="nullo" class="sf-menu">
      <li>
        <a class="tito" href="/amministra/"><img src="/inc/files/images/adminplus.png"></a><div class="ams">AMMINISTRA</div>

           <ul>
                                        <li>
                            <a class="tab_amministra" href="/amministra/gestione_commerciale/" title="">
                              Commerciale                           </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_eccellenze/" title="">
                              Eccellenze                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_aree/" title="">
                              Aree                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_contabile/" title="">
                              Contabile                         </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_certificazioni/" title="">
                              Certificazioni                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_compensi/" title="">
                              Compensi                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_trattative/" title="">
                              Trattative                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_club/" title="">
                              Club                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_guida/" title="">
                              Guida                         </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_pagine/" title="">
                              Pagine                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_mailing/" title="">
                              Mailing                           </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_report/" title="">
                              Report                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_batching/" title="">
                              Batching                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_temi_seo/" title="">
                              Classificazione                           </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_visite_pagine/" title="">
                              VIsite pagine                         </a>
                        </li>
                                   </ul>
      </li>
</ul>


          <li><a href="/">Home</a></li>
                        <li>
                <a href="/vacanze_weekend/">
                Vacanze             </a>
            </li>
                        <li>
                <a href="/matrimoni/">
                Matrimoni               </a>
            </li>
                        <li>
                <a href="/meeting/">
                Meeting             </a>
            </li>

          </li>

                    <li><span class="current-lang">ita</span> | <a href="/en/" title="English - Luxury hotels and historical boutique hotels">ENG</a></li>
手机中的

菜单:

<div id="header" class="clearfix">
    <ul id="top-menu">

    <ul id="nullo" class="sf-menu">
      <li>
        <a class="tito" href="/amministra/"><img src="/inc/files/images/adminplus.png"></a><div class="ams">AMMINISTRA</div>

           <ul>
                                        <li>
                            <a class="tab_amministra" href="/amministra/gestione_commerciale/" title="">
                              Commerciale                           </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_eccellenze/" title="">
                              Eccellenze                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_aree/" title="">
                              Aree                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_contabile/" title="">
                              Contabile                         </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_certificazioni/" title="">
                              Certificazioni                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_compensi/" title="">
                              Compensi                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_trattative/" title="">
                              Trattative                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_club/" title="">
                              Club                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_guida/" title="">
                              Guida                         </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_pagine/" title="">
                              Pagine                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_mailing/" title="">
                              Mailing                           </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_report/" title="">
                              Report                            </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_batching/" title="">
                              Batching                          </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_temi_seo/" title="">
                              Classificazione                           </a>
                        </li>
                                                <li>
                            <a class="tab_amministra" href="/amministra/gestione_visite_pagine/" title="">
                              VIsite pagine                         </a>
                        </li>
                                   </ul>
      </li>
</ul>


          <li><a href="/">Home</a></li>
                        <li>
                <a href="/vacanze_weekend/">
                Vacanze             </a>
            </li>
                        <li>
                <a href="/matrimoni/">
                Matrimoni               </a>
            </li>
                        <li>
                <a href="/meeting/">
                Meeting             </a>
            </li>

          </li>

                    <li><span class="current-lang">ita</span> | <a href="/en/" title="English - Luxury hotels and historical boutique hotels">ENG</a></li>

0 个答案:

没有答案