2016-09-22, 09:51 AM
Hey guys,
Just wrote a simple tutorial on adding responsive dropdown navigation menu in MyBB 1.8, thought I should share with you all.
Live Demo – http://codepen.io/WallBB/pen/bwwwBL
It is 3 step tutorial and easy to follow :-
Steps :-
1. First of all open the header template located at -> Admin CP > Templates and Styles > Templates > Your Theme Template > header Templates > header and add the below code just above
2. Go to your theme and click add stylesheet. Write the name as responsive_menu.css and click write my own content.
3. Paste the below content and click save stylesheet.
Go to your live forum and you will see a responsive dropdown menu for MyBB forums something like these
![[Image: Responsive-Meny-MyBB-desktop.png]](https://camo.mybb.com/de06fd8ba43a9df209b1ad4ee491da14ac8ef56e/687474703a2f2f77616c6c62622e636f2e756b2f77702d636f6e74656e742f75706c6f6164732f323031362f30392f526573706f6e736976652d4d656e792d4d7942422d6465736b746f702e706e67)
![[Image: responsive-menu-mybb-236x420.png]](https://camo.mybb.com/20d1b4d11b716e018363ce53fb56bee2daff994a/687474703a2f2f77616c6c62622e636f2e756b2f77702d636f6e74656e742f75706c6f6164732f323031362f30392f726573706f6e736976652d6d656e752d6d7962622d323336783432302e706e67)
![[Image: Responsive-menu-mybb-dropdown.png]](https://camo.mybb.com/950daa3415a6a3320da04146a3a11f9b57247e85/687474703a2f2f77616c6c62622e636f2e756b2f77702d636f6e74656e742f75706c6f6164732f323031362f30392f526573706f6e736976652d6d656e752d6d7962622d64726f70646f776e2e706e67)
Original Tutorial - http://wallbb.co.uk/simple-three-step-tu...bb-forums/
Hope it helps you get a responsive menu, in case of any questions just let me know.
Regards
WallBB
Just wrote a simple tutorial on adding responsive dropdown navigation menu in MyBB 1.8, thought I should share with you all.
Live Demo – http://codepen.io/WallBB/pen/bwwwBL
It is 3 step tutorial and easy to follow :-
Steps :-
1. First of all open the header template located at -> Admin CP > Templates and Styles > Templates > Your Theme Template > header Templates > header and add the below code just above
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<nav>
<label for="drop" class="toggle"><i class="fa fa-bars" aria-hidden="true"></i> Menu</label>
<input type="checkbox" id="drop" />
<ul class="menu">
<li><a href="{$mybb->settings['bburl']}/index.php" class="Home"><span><i class="fa fa-home" aria-hidden="true"></i> Home</span></a></li>
<li><a href="{$mybb->settings['bburl']}/memberlist.php" class="Members"><span><i class="fa fa-user" aria-hidden="true"></i> Memberlist</span></a></li>
<li><a href="{$mybb->settings['bburl']}/search.php" class="Search"><span><i class="fa fa-search" aria-hidden="true"></i> Search</span></a></li>
<li><a href="{$mybb->settings['bburl']}/advertise.php"><span><i class="fa fa-globe" aria-hidden="true"></i> Advertise</span></a></li>
<li>
<!-- First Tier Drop Down -->
<label for="drop-1" class="toggle">Dropdown <i class="fa fa-sort-desc" aria-hidden="true"></i></label>
<a href="#">Dropdown</a>
<input type="checkbox" id="drop-1"/>
<ul>
<li><a href="#">Links</a></li>
<li><a href="#">Links</a></li>
<li><a href="#">Links</a></li>
</ul>
</li>
<li>
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help" class="help"><span><i class="fa fa-question"></i> {$lang->toplinks_help}</span></a></li>
</ul>
</nav>
2. Go to your theme and click add stylesheet. Write the name as responsive_menu.css and click write my own content.
3. Paste the below content and click save stylesheet.
.toggle, [id^="drop"] {
display: none;
}
nav {
background: #333;
margin: 0;
padding: 0;
}
nav::after {
clear: both;
content: "";
display: table;
}
nav ul {
list-style: outside none none;
margin: 0;
padding: 0;
position: relative;
}
nav ul li {
border-left: 1px solid #555;
display: inline-block;
float: left;
margin: 0;
}
nav a {
background: #222;
color: #fff;
display: block;
font-family: Helvetica,Arial,Verdana,sans-serif;
font-size: 12px;
padding: 10px 15px;
text-decoration: none;
}
nav ul li ul li:hover {
background: #444 none repeat scroll 0 0;
}
nav a:hover {
background-color: #000000;
}
nav ul ul {
display: none;
position: absolute;
top: 35px;
}
nav ul li:hover > ul {
display: inherit;
}
nav ul ul li {
display: list-item;
float: none;
position: relative;
width: 170px;
}
nav ul ul ul li {
left: 170px;
position: relative;
top: -60px;
}
nav ul li > a::after {
content: " ";
display: inline;
font-family: fontawesome;
}
nav ul li > a:only-child::after {
content: "";
}
@media all and (max-width: 768px) {
nav {
margin: 0;
}
.toggle + a, .menu {
display: none;
}
.toggle {
background: #333;
border: medium none;
color: #ffffff;
display: block;
font-family: Helvetica,Arial,Verdana,sans-serif;
font-size: 12px;
padding: 10px 15px;
text-decoration: none;
}
.toggle:hover {
background-color: #000000;
}
[id^="drop"]:checked + ul {
display: block;
}
nav ul li {
display: block;
width: 100%;
}
nav ul ul .toggle, nav ul ul a {
padding: 0 40px;
}
nav ul ul ul a {
padding: 0 80px;
}
nav a:hover, nav ul ul ul a {
background-color: #000000;
}
nav ul li ul li .toggle, nav ul ul a, nav ul ul ul a {
color: #ffffff;
font-size: 12px;
padding: 10px 15px;
}
nav ul li ul li .toggle, nav ul ul a {
background-color: #212121;
}
nav ul ul {
color: #ffffff;
float: none;
position: static;
}
nav ul ul li:hover > ul, nav ul li:hover > ul {
display: none;
}
nav ul ul li {
display: block;
width: 100%;
}
nav ul ul ul li {
position: static;
}
}
@media all and (max-width: 330px) {
nav ul li {
display: block;
width: 94%;
}
}
@media only screen and (min-width: 769px) {
nav ul {
margin-left: 8%;
}
nav ul ul {
margin-left: 0;
}
}
/*
Tutorial by WallBB
http://wallbb.co.uk
*/
Go to your live forum and you will see a responsive dropdown menu for MyBB forums something like these
Original Tutorial - http://wallbb.co.uk/simple-three-step-tu...bb-forums/
Hope it helps you get a responsive menu, in case of any questions just let me know.
Regards
WallBB
- MyBB
