可愛的人。手機下拉菜單漢堡
我是編碼方面的新手,所以我已經看過所有的論壇,但似乎無法獲得菜單,點擊我的FA圖標。也許我不明白一些事情。
我的手機菜單我想是這樣的:
我有我的主要導航和移動的主要導航上的相互
<nav class="nav nav__primary clearfix">
<ul id="topnav" class="sf-menu sf-js-enabled">
<li><a href="https://staging1.herbalnitro.com">Home</a></li>
<li><a href="https://staging1.herbalnitro.com/shop">Shop</a></li>
<li><a class="sf-with-ul" href="https://staging1.herbalnitro.com/shop">
<span class="sf-sub-indicator"></span>
Products</a>
<ul class="sub-menu">
<li><a href="https://staging1.herbalnitro.com/product/allura-trim-appetite-control-weight-loss">Allura Trim Fitness Stick</a></li>
<li><a href="https://staging1.herbalnitro.com/product/colon-cleanse-detox-cleanse-duo/">Colon Cleanse Detox Duo</a></li>
<li><a href="https://staging1.herbalnitro.com/product/detox-maximo-colon-cleanse/">Detox Maximo Colon Cleanse</a></li>
<li><a href="https://staging1.herbalnitro.com/product/extreme-energy/">Extreme Energy</a></li>
<li><a href="https://staging1.herbalnitro.com/product/fuel-for-the-body-natural-energy-booster/">Fuel for the Body</a></li>
<li><a href="https://staging1.herbalnitro.com/product/my-gentle-cleanse-colon-health/">My Gentle Cleanse 30</a></li>
<li><a href="https://staging1.herbalnitro.com/product/my-gentle-detox-colon-care/">My Gentle Detox 30</a></li>
</ul>
</li>
<li><a href="https://staging1.herbalnitro.com/herbal-nitro-life-blog">Blog</a></li>
<li><a href="https://staging1.herbalnitro.com/contact-us">Contact</a></li>
</ul>
<ul id="mobile-nav" class="sf-menu sf-js-enabled">
<li><a href="https://staging1.herbalnitro.com">Home</a></li>
<li><a href="https://staging1.herbalnitro.com/shop">Shop</a></li>
<li><a href="https://staging1.herbalnitro.com/shop">Products</a></li>
<li><a href="https://staging1.herbalnitro.com/herbal-nitro-life-blog">Blog</a></li>
<li><a href="https://staging1.herbalnitro.com/contact-us">Contact</a></li>
</ul>
我要頂將#mobile-nav鏈接到圖像中的漢堡包圖標,這裏我有:
<a href="#mobile-nav" class="fa fa-bars" aria-hidden="true"></a>
<a href="https://herbalnitro.com"><img src="https://staging1.herbalnitro.com/wp-content/uploads/2017/09/Logo-165x40.png" /></a>
<a href="#" class="fa fa-shopping-cart" aria-hidden="true"></a>
<a href="https://staging1.herbalnitro.com/my-account" class="fa fa-user" aria-hidden="true"></a>
<a href="#" class="fa fa-search" aria-hidden="true"></a>
您不必解決問題,但有些幫助會很棒。
非常感謝! 的js
編輯:子主題自定義腳本
(function($) {
$(function(){
//Dropdown cart in header
$('.cart-holder > h3').click(function(){
if($(this).hasClass('cart-opened')) {
$(this).removeClass('cart-opened').next().slideUp(300);
} else {
$(this).addClass('cart-opened').next().slideDown(300);
}
});
//Popup rating content
$('.star-rating').each(function(){
rate_cont = $(this).attr('title');
$(this).append('<b class="rate_content">' + rate_cont + '</b>');
});
});
})(jQuery的);
我認爲最好是,如果你看看一些在線例子,如果你想自己達到解決方案https://codepen.io/g13nn/pen/eHGEF使用jquery和https://codepen.io/ erikterwan/pen/EVzeRP僅使用css。如果你不發佈任何你一直在使用的css/js,那麼我們有點難以幫助你。 – Wouter
我明白了。感謝您的參考,Wouter!我已經看到了這兩個,但我肯定會嘗試深入探索第一個。我會將修改過的jquery粘貼到我的子主題的自定義腳本中嗎?見上面的編輯。 – Poocey