MyBB Community Forums

Full Version: drop down nav
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hiya, on my website, I have the following code in the head tags of my website:

<style>
/* Main menu settings */
#navigation_bar {
   clear:both;
   float:left;
   margin:0;
   padding:0;
   width:100%;
   font-family:Verdana, Geneva, sans-serif; /* Menu font */
   font-size:120%; /* Menu text size */
   z-index:1000; /* This makes the dropdown menus appear above the page content below */
   position:relative;
}

/* Top menu items */
#navigation_bar ul {
   margin:0;
   padding:0;
   list-style:none;
   float:centre;
   position:relative;
   right:50%;
}
#navigation_bar ul li {
   margin:0 0 0 0px;
   padding:0;
   float:left;
   position:relative;
   left:50%;
   top: 0;
   background:#b4e3ef;
}
#navigation_bar ul li a {
   display:block;
   margin:0;
   font-size:2em;
   line-height:0;
   text-decoration:none;
   color:#444;
   font-weight:bold;
}
#navigation_bar ul li a:hover {
/* Top menu items background colour */
   color:#fff;
   
}
#navigation_bar ul li:hover a,
#navigation_bar ul li.hover a { /* This line is required for IE 6 and below */
 /* Top menu items background colour */
   color:#fff;
   
}

/* Submenu items */
#navigation_bar ul ul {
   display:none; /* Sub menus are hidden by default */
   position:absolute;
   top:2.3em;
   left:0;
   right:auto; /*resets the right:50% on the parent ul */
   width:10em; /* width of the drop-down menus */
}
#navigation_bar ul ul li {
   left:auto;  /*resets the left:50% on the parent li */
   margin:0; /* Reset the 1px margin from the top menu */
   clear:left;
   width:100%;
}
#navigation_bar ul ul li a,
#navigation_bar ul li.active li a,
#navigation_bar ul li:hover ul li a,
#navigation_bar ul li.hover ul li a { /* This line is required for IE 6 and below */
   font-size:.8em;
   font-weight:normal; /* resets the bold set for the top level menu items */
   color:#444;
   line-height:2.4em; /* overwrite line-height value from top menu */
   border-bottom:1px solid #ddd; /* sub menu item horizontal lines */
}
#navigation_bar ul ul li a:hover,
#navigation_bar ul li.active ul li a:hover,
#navigation_bar ul li:hover ul li a:hover,
#navigation_bar ul li.hover ul li a:hover { /* This line is required for IE 6 and below */
   background:#36f; /* Sub menu items background colour */
   color:#fff;
}

/* Flip the last submenu so it stays within the page */
#navigation_bar ul ul.last {
   left:auto; /* reset left:0; value */
   right:0; /* Set right value instead */
}

/* Make the sub menus appear on hover */
#navigation_bar ul li:hover ul,
#navigation_bar ul li.hover ul { /* This line is required for IE 6 and below */
   display:block; /* Show the sub menus */
}
	</style>

I also have this code in the body tags:

<div id="navigation_bar">
                    <ul>
                        <li></li>
                        <li><a href="http://habfab.com/v2" id="thehablets"></a>
                        </li>
                        
                        <li><a href="#" id="radio"></a>
                        <ul>
                        <li><a href="javascript:ajaxpage('/pages/radio/requests.php', 'content');">Request line</a></li> 
                        <li><a href="javascript:ajaxpage('/staffpanel/_frontend/timetable.php', 'content');">Timetable</a></li> 
                        <li><a href="javascript:ajaxpage('/staffpanel/_frontend/recent.php', 'content');">Recent Songs</a></li>
                        <li><a href="javascript:ajaxpage('/pages/radio/djotw.php', 'content');">Djotw</a></li>
                        </ul> 
                        </li>
                        
                        <li><a href="javascript:ajaxpage('/staffpanel/_frontend/news.php', 'content');" id="news"></a>
                        <ul>
                        <li><a href="javascript:ajaxpage('/pages/news/sitenews.php', 'content');">Site News</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/news/habbonews.php', 'content');">Habbo News</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/news/reallifenews.php', 'content');">Real Life News</a></li>
                        </ul> 
                        </li>
                        
                        <li><a href="#" id="guides"></a>
                        <ul>
                        <li>Coming soon!</li> 
                        </ul> 
                        </li>
                        
                        <li><a href="#" id="events"></a>
                        <ul>
                        <li><a href="javascript:ajaxpage('/pages/events/eventstoday.php', 'content');">Events Today</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/events/eventsthisweek.php', 'content');">Events This Week</a></li> 
                        </ul> 
                        </li>
                        
                        <li><a href="#" id="media"></a>
                        <ul>
                        <li>Coming soon!</li> 
                        </ul> 
                        </li>
                        
                        <li><a href="#" id="media"></a>
                        <ul>
                        <li><a href="javascript:ajaxpage('/pages/goodies/fontgenerator.php', 'content');">Font Generator</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/goodies/thronegenerator.php', 'content');">Throne Generator</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/goodies/kissinggenerator.php', 'content');">Kissing Generator</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/goodies/clubsofagenerator.php', 'content');">Club Sofa Generator</a></li> 
                        <li><a href="javascript:ajaxpage('/pages/goodies/djgenerator.php', 'content');">djgenerator</a></li> 
                        </ul> 
                        </li>
                        
                        <li><a href="#" id="jobs"></a>
                        <ul>
                        <li><a href="javascript:ajaxpage('/pages/jobs/open.php', 'content');">Open Jobs</a></li> 
                        </ul> 
                        </li>
                        
                        
                        <li><a href="#" id="forum"></a>
                        <ul>
                        <li><a href="http://habfab.com/forum" target="_blank">Board</a></li> 
                        <li><a href="http://habfab.com/forum/member.php?action=login" target="_blank">Login</a></li> 
                        <li><a href="http://habfab.com/forum/member.php?action=register" target="_blank">Register</a></li>
                        <li><a href="http://habfab.com/forum/showteam.php" target="_blank">Staff</a></li>
                        <li><a href="http://habfab.com/forum/donate.php" target="_blank">Donate</a></li>
                        </ul> 
                        </li>                                   
                       </ul>
                </div>

My question is how can i get this navigation bar into my forum?
+ rep to anyone who helps!

Thanks Smile

~ David
Bump

~ David
Put the CSS in global.css and the HTML in the header template.
(2012-02-12, 07:59 PM)Alan Shepperson Wrote: [ -> ]Put the CSS in global.css and the HTML in the header template.

Hiya Alan,

Just tried this, and it's not displaying in the drop down format. Thanks Smile

~ David
bump

~ David
How is it displaying? Screenshot or URL?
(2012-02-14, 01:00 AM)Alan Shepperson Wrote: [ -> ]How is it displaying? Screenshot or URL?

http://habfab.com/forum/index.php

Go to the bottom, and select "HabFab Spring" in the mytheme

thanks Smile

~ David