Skip to main content

Add a responsive dropdown menu To Your Blog on blogger




This responsive dropdown menu will definitely make your blog look stylish and professional, to say the least.
Initially, I had a horizontal menu display which kind of took a good amount of space in my blog's mobile view.
Originally gotten from mybloggerlab, I only made minor tweaks by adding the social bar and search box as well as making it sticky.
Below are the features of this menu
Responsive - this menu is very responsive  and doesn't take much space in your blog. If you use the default blogger template, a switch between desktop and menu view leaves you with the desktop and mobile menu respectively.
Light weight - this menu for the health of your blog is light wight and loads instantly with your blog.
Note; This dropdown menu doesn't have sub-menu thus not suitable for those in search of a menu bar with sub-menu and you may have to continue your search!
All the same, this menu is perfect!
How to add the Responsive dropdown menu with social and search box to blogger...
Before you take more steps, please back up your template, in case you make some unknown mistakes.
Need a Demo? Check it out 

Step 1- Adding the CSS
Search for ]]></b:skin>, then paste the CSS code below just above it.

/*** Dropdown Menu***/
#nav-wrapper {
 margin:0 auto;
 position: fixed;
 width:100%;
 float: none !important;
     top: 0px;
     padding-bottom: 5px;
     z-index: 1;
     height: 20px;
     border-bottom: 1px solid #fafafa;
}
#nav-trigger {
    display: none;
    text-align: left;
}
#nav-trigger span {
    display: block;
    background-color: #000;
    cursor: pointer;
    text-transform: uppercase;
    padding: 0 25px;
    color: #EEE;
    line-height: 50px;
}
nav#nav-mobile {
    margin: 0px;
}
nav {
    margin-bottom: 30px;
}
#nav-main {
 background-color: #000;
    float: left;
    width: 100% !important;
}
#nav-main ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    text-align: left;
}
#nav-main li {
    display: inline-block;
    float: left;
    ont-family: '
    Open Sans'
    , sans-serif;
}
#nav-main li:last-child {
    border-right: none;
}
#nav-main a {
    padding: 0 25px;
    color: #EEE;
    line-height: 67px;
    display: block;
}
#nav-main a:hover {
    background-color: #edbf9d;
    text-decoration: none;
    color: #fff;
}
#nav-mobile {
    position: relative;
    display: none;
}
#nav-mobile ul {
    display: none;
    list-style-type: none;
    position: absolute;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    background-color: #000;
    z-index: 10;
    padding: 0px;
    border-bottom: solid 1px #171717;
}
nav#nav-mobile li:last-child {
    border-bottom: none;
}
nav#nav-mobile ul {
    padding: 0;
    margin: 0;
}
nav#nav-mobile a {
    display: block;
    color: #fff;
    padding: 10px 0px;
    text-decoration: none;
    border-bottom: 1px solid #3a3a3a;
    text-align: left;
}
nav#nav-mobile a:hover {
    background-color: #111;
    color: #fff;
}
nav#nav-mobile li {
    display: block;
}

nav#nav-mobile {
    display: none;
}

@media all and (max-width: 900px) {
    #nav-trigger {
        display: block;
    }
    #nav-main {
        display: none!important;
    }
    nav#nav-mobile {
        display: block;
    }
}
@media screen and (max-width : 699px) {
#nav-wrapper {
 width: 100%;
margin : 0em;
padding: 0px;
}
}

You can make some major changes by replacing the #000 background-color with your desired colour. This will change the look and feel of your menu bar.

Step 2- Adding the HTML code
To add the menu, go to the html of your theme and search for </header> now add the html code below immediately after/below it for better results, you can as well search for <header> and place the code below before/above it if you want your menu list to appear before your header.

<div id='nav-wrapper'>
<nav id='nav-main'>
    <ul>
    <li><a class='homer' href='#'><i class='fa fa-home'/> HOME</a>
    </li>
<li><a href='/p/about.html'>About</a>
</li>
<li><a href='/p/contact.html'>Contact</a></li>
<li><a href='/p/copyright.html'>Copyright</a></li>
<li><a href='/p/privacy.html'>Privacy Policy</a></li>
<li><a href='/p/disclcoder.html'>Disclaimer</a></li>
<li><a href='/p/terms.html'>Terms</a></li>  
  </ul>
</nav>
<div id='nav-trigger'>
    <span><i class='fa fa-list fa-2x'/></span>
</div>
<nav id='nav-mobile'/> 
</div>

Please replace page links with the correct links in your blog if necessary. You can add more links by
editing and pasting this <li><a href='LINK HERE'>LINK TITLE</a></li> below </ul>


Step 3- Adding the JavaScript code
Now search for </body> and paste the code below just above it.

<script type='text/javascript'>
//<![CDATA[
$undefineddocument).readyundefinedfunctionundefined){
    $undefined"#nav-mobile").htmlundefined$undefined"#nav-main").htmlundefined));
    $undefined"#nav-trigger span").clickundefinedfunctionundefined){
        if undefined$undefined"nav#nav-mobile ul").hasClassundefined"expanded")) {
            $undefined"nav#nav-mobile ul.expanded").removeClassundefined"expanded").slideUpundefined250);
            $undefinedthis).removeClassundefined"open");
        } else {
            $undefined"nav#nav-mobile ul").addClassundefined"expanded").slideDownundefined250);
            $undefinedthis).addClassundefined"open");
        }
    });
});
//]]>
</script>
And that's it...
Save your template, check your blog and enjoy! Encountered any problem?
Let me know in the comment box.

Comments

Popular posts from this blog

Earn While you Save With Alat.ng

If you've always wanted to save up for the future, but didn't take actions for reasons best known to you, now is the time to reconsider your thoughts and take actions, because there is a digital bank known as ALAT waiting to be utilized. What Is A Digital Bank? According to Avoka.com; "Digital banking is the digitization (or moving online) of all the traditional banking activities and programs that historically were only available to customers when physically inside of a bank branch." What is ALAT? ALAT is a digital bank, the first if its kind in Nigeria! It is an innovation of Wema Bank Nigeria, developed to give you easy access to saving your funds and doing other bank transactions without being physically present at the bank.  With Alat digital bank, you can open a savings account using your phone number and Bank Verification Number (BVN) as well as other documents that you will be prompted to upload during the registration process. It’s simple, convenient, reliabl...

Beautify Your Blogspot Blog With TESH, A Premium Premade Blogger Template

If you've been looking for a stylish template for your blogger blog, then you'll definitely love the look and feel of "Tesh", a classic, chic, as well as black and white premade blogger template, suitable for personal, fashion, lifestyle bloggers as well as other bloggers. Tesh is not only classic but responsive and has been built to beautify your blog's view... If you've been looking for a minimalist blogger template that isn't heavy but lightweight, then tesh is perfect just for you... No fuss, she's worth your thoughts and utilization. Note: This is a blogger template, it wouldn't work on WordPress, tumblr or any other platform but blogger. Demo - http://www.tesh-demo.blogspot.com Features of Tesh ~ Responsive layout ~ Auto read more button ~ Breadcrumbs in post page ~ Related posts widget ~ Classic share buttons ~ Stylish about me widget ~ Beautiful labels design ~ Numbered page navigation ...

Just Another Way To Save With A Piggybank

While growing up, I wished for a piggybank, despite having access to numerous saving boxes. Trust me, I always thought a piggy bank would be great and advanced than a square box! At least it wasn't our conventional DIY savings method. But then, what if my dream had come true, maybe not at the time I wanted it but sometime later? I'd probably save and get to destroy my bank! Piggybank is a generic English term used to denote the earliest means of storage of money, using a hollow ceramic statue of a pig. Well, did you ever use a savings box and wished for a Piggy bank? It's probably time to stop being archaic and get digital because, there's a Piggy bank in town who's gone so digital. About piggybank.ng In a brief note, Piggybank.ng is a Nigerian Financial Technology (Fintech) startup which run a hassle free online savings scheme. Piggybank if granted access to a user's bank account will make periodic deductions for the purpose of saving towards a target. This inn...