A simple Drop Down Menu For Blogger
33 COMMENTSDrop Down Menus are great for adding multiple links in your blog and yet they require very little space space. In addition it makes the site more user friendly and gives it a more professional look. I am going to show you how to add a customizable drop down menu to your blogger blog.
Drop Down Menu Preview:
Follow these steps to add a drop down menu to your Blog:
1. Go to Layout->Edit Html
2. Download Full Template (This is to backup your template, so that you don’t lose any data).
3. Check the Expand Widget Templates
4. Now search for the following code:
</head>
5. Just place the following code before the code above.
<style>
#sddm
{ margin: 0;
padding: 0;
z-index: 30}#sddm li
{ margin: 0;
padding: 0;
list-style: none;
float: left;
/*Font of menu top*/
font: bold 11px arial}#sddm li a
{ display: block;
margin: 0 1px 0 0;
padding: 4px 10px;
/*width of each menu top*/
width: 60px;
/*background color of main menu*/
background: #5970B2;/*text color of main menu*/
color: #FFFFFF;
text-align: center;
text-decoration: none}#sddm li a:hover
{/*background color of main menu on hover*/
background: #49A3FF}#sddm div
{ position: absolute;
visibility: hidden;
margin: 0;
padding: 0;/*background color of drop down menu */
background: #FFFFFF;
/*border of the drop down menu*/
border: 1px solid #5970B2}#sddm div a
{ position: relative;
display: block;
margin: 0;
padding: 5px 10px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
/*background color of each menu element*/
background: #FFFFFF;
/*text color of each menu element*/
color: #2875DE;
/*font of each menu element*/
font: 11px arial}#sddm div a:hover
{
/*background of each element on hover*/
background: #49A3FF;
/*font color of each menu item on hover*/
color: #FFFFFF}
</style>
<script type=’text/javascript’>var timeout = 500;
var closetimer = 500;
var ddmenuitem = 0;// open hidden layer
function mopen(id)
{
// cancel close timer
mcancelclosetime();// close old layer
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';// get new layer and show it
ddmenuitem = document.getElementById(id);
ddmenuitem.style.visibility = 'visible';}
// close showed layer
function mclose()
{
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}// go close timer
function mclosetime()
{
closetimer = window.setTimeout(mclose, timeout);
}// cancel close timer
function mcancelclosetime()
{
if(closetimer)
{
window.clearTimeout(closetimer);
closetimer = null;
}
}// close layer when click-out
document.onclick = mclose;
</script>
6. Customize the drop down menu(optional):
You can customize the menu according to your blog. This is optional and use it only if you want a different look than the one already available.
The menu consists of three sections as shown in the figure:
1. Main Menu
2. Drop Down Menu
3. Element of Drop Down Menu
In the code you will find some comments. Below the comments you have some editable code.
Here is the explanation of some of the attributes used in the code:
Background: #XXXXXX
This attribute decides the background of the part and XXXXXX is the hex code of the color. You can change the background of each of the three parts.
Color:#XXXXXX
The color attribute decides the color of the text and XXXXXX is the color hex code.
You can get color hex codes from these online color choosers
ColorPicker
width: 123 px
The width determines the width of each element. You can increase or decrease the width according to your choice.
7. Adding the Menu:
a.Go to Layout>Page Elements
b.Then click on Add Gadget
d.Then Add the Following code
<ul id=”sddm”>
<li><a href=”#”
onmouseover=”mopen(‘m1′)”
onmouseout=”mclosetime()”>Home</a>
<div id=”m1″
onmouseover=”mcancelclosetime()”
onmouseout=”mclosetime()”>
<a href=”#”>HTML Drop Down</a>
<a href=”#”>DHTML Menu</a>
<a href=”#”>JavaScript DropDown</a>
<a href=”#”>Cascading Menu</a>
<a href=”#”>CSS Horizontal Menu</a>
</div>
</li>
<li><a href=”#”
onmouseover=”mopen(‘m2′)”
onmouseout=”mclosetime()”>Download</a>
<div id=”m2″
onmouseover=”mcancelclosetime()”
onmouseout=”mclosetime()”>
<a href=”#”>ASP Dropdown</a>
<a href=”#”>Pulldown menu</a>
<a href=”#”>AJAX Drop Submenu</a>
<a href=”#”>DIV Cascading Menu</a>
</div>
</li>
<li><a href=”#”>Order</a></li>
<li><a href=”#”>Help</a></li>
<li><a href=”#”>Contact</a></li>
</ul>
<div style=”clear:both”></div>
Note: Replace # by the link of the item and if you want to add the menu, say the third element.
Replace <a href=”#”>Order</a> by the following code:
<a href=”#”
onmouseover=”mopen(‘m3′)”
onmouseout=”mclosetime()”>Home</a>
<div id=”m3″
onmouseover=”mcancelclosetime()”
onmouseout=”mclosetime()”>
<a href=”#”>HTML Drop Down</a>
<a href=”#”>DHTML Menu</a>
<a href=”#”>JavaScript DropDown</a>
<a href=”#”>Cascading Menu</a>
<a href=”#”>CSS Horizontal Menu</a>
</div>
This is for the third menu, for the fourth replace each m3 by m4
f. Save the Gadget and the work is over. The Drop Down menu is live!
Credits: Javascript Array.
Do you have any questions? Tell me!
| This entry was posted by Gautam on June 6, 2009 at 5:19 pm, and is filed under blogger. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |













about 1 year ago
Your menu works great (thank you!) but I'm having a problem, which is that the drop down parts of the menu fall underneath the top post, so they can't be seen. How do I get it to drop down OVER the post so it can be seen and clicked on?
My test page is at http://ooeygooeychocolate.blogspot.com (Pay no attention to the original nav bar and the links I have there. As I said, I'm using this as a test site right now so I can make the change to my real blog when this design is perfected) I sure hope you can help me out, because I'd really like to use your menu!
Reply
about 1 year ago
I don't see any drop down menu on your blog. I have tried it and it worked properly. Tell me if you're still facing a problem
Reply
about 1 year ago
I'm having the same problem as above.. If you go to my blog and hold the mouse over "our happenings" then go down to one the the subcategories there.. it will take you to the post will that label. Well, when it is on one of these pages the drop down menu goes BEHIND the label post info.. the rest of it works perfectly… above it and below it but the part that crosses over with the label post box the drop down menue goes behind it and you are unable to successfully continue to that link.
Help please!!! =)
My blog is http://www.youandmeplusthree.com
Reply
about 1 year ago
Do you know a way I can fix the above problem I am having? I guess I can start looking for a new code, but since I have this one installed already I would like to keep and use it.
Thanks!
Reply
about 1 year ago
Hi –
Thanks for this. I was wondering if there is a way to modify the menu's width… I need it to be exactly 810px wide for my blog and flush with my header. Any ideas?
Thanks!
Reply
about 1 year ago
@Melissa DeSchamp Photography: replace the code of width: auto with the width you want to display i.e width:810px
Reply
about 12 months ago
Hi
I can not seem to figure out how to get rid of the "HOME" & "DOWNLOAD"
I just want to show links to my photos that are listed at right.
I just got the hang of doing html now everything is css.
Thanks in advance'
Reply
about 12 months ago
@Kashmier: You have to edit the text Home and Download in the code and replace with the text you want to display. And this is in the html code only not the css
Reply
about 11 months ago
Hello! Thankyou for posting these instructions!
My main menu is fine, although nothing appears when i hover over each link! If i click them it goes to the correct location, just the subheadings do not show at all.
Thanks in advance
Kiara
Reply
about 11 months ago
Hello! Thank you for posting this. It seems to work great on the post(s) pages on my blog but the menu doesn't show up on the main page. Do you know how I can fix this?
Reply
about 11 months ago
I think you should check where you have placed your code. Maybe your code is such that it displays on single posts but not on the main page
Reply
about 11 months ago
Can you pls take a snapshot as i am not able to see your website
Reply
about 11 months ago
So, I got the dropdown menu to work properly and everything, but I would like to know how you add multiple levels/layers. For instance, visit my blog: http://www.wildstateofhockey.com. Under the "Pre-Game Archive" and "Post-Game Archive" tabs I'd like to add each month and then have each game from that particular month available to click on… so, I'd need one more level/layer to the first one that drops down.
Any help would be greatly appreciated! I really need to get this set up soon! Please reply back as quickly as possible!
Reply
about 11 months ago
I got what you are talking about. You want a multiple drown down menu for blogger. This type of drop down menu has many layers. Stay tuned i will post about it later.
Recent blog:=- How to create a Facebook Page for your Blog/Website
Reply
about 11 months ago
lol Well I need my website to have this multiple level drop-down as soon as possible… so if you could write about it quickly, I'd greatly appreciate it!!! Thank you.
Reply
about 11 months ago
Will do it as quickly as possible just stay updated with the Rss Feed because i will make a new post about it soon.
Recent blog:=- 33 super engagers to follow
Reply
about 11 months ago
Thanks for the simple and clear tutorial. I used your code, with some modification of color and adding images and am very happy with the results.
Reply
about 10 months ago
Great code, Very easy to edit…
but i'm still an html newbie…
How would I go about inserting it into a page? without using the 'HTML/JAVA' feature of blogger. Because I'm using a custom theme, there is not gadget area along the top of the page… but when i try to add this code it says that Your template could not be parsed as it is not well-formed". I'm not askign for direct help, but it would be nice if you could push me in the right direction.
Thanks again for the code and tutorial
Recent blog:=- qer4q
Reply
about 10 months ago
MAke sure you copy the correctly and if it is not working , convert this code via the Ad code converter
Reply
about 9 months ago
great work man… its amazing…
Recent blog:=- Job Prospects in Indian Banking Sector
Reply
about 9 months ago
Nice information friend. I will try this in my website. Hope it works
Recent blog:=- Get the Best Gifts this Winter
Reply
about 9 months ago
Hi there,
Great drop-down menu, a real nice addition to my blog that I am building.
However, I wonder if you can help me out? One the drop down items, the left hand side of the box aligns to the left hand side. I would like the box to be centered when it drops down over the menu heading text (ie drop down down boxes center under ‘ About’, ‘Music Videos’ etc).
Would you be able to help me here, as for the life of me, I cannot see what to amend (or where I am going wrong!).
Here is my blog address:
http://shiftkeyfilms.blogspot.com/
Many thanks in advance for all your help.
Adrian
Adrian´s last blog ..TEST 1
Reply
December 31, 2009 - 6:31 pm
you need more css knowledge to edit this. try w3schools.com for more info about css
Reply
January 4, 2010 - 10:21 am
Hi,
Thanks for the info – very useful!
I am having the same problems as those at the top of this forum.
The drop-down menu does not drop down over the elements below, so only displays one option in drop-down boxes.
Is there an easy way to fix this? It seems that a couple of other users have had this same problem as well as above at top of forum.
Many thanks in advance for your help.
Here is my blog address:
http://shiftkeyfilms.blogspot.com/
All the best,
Adrian
Adrian´s last blog ..TEST 1
Reply
about 9 months ago
I want to use this code, but I also want to keep the graphic I already have for my navbar now (and it has a search bar in it already) will this work?
Go here to see what I mean:
http://lsosthisisonlyatest.blogspot.com/
Shan @ Last Shreds Of Sanity´s last blog ..What’s In Santa’s Sleigh?: Disney On Ice Worlds Of Fantasy Family Pack Giveaway
Reply
about 8 months ago
It gives me this error…
Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute “{1}” associated with an element type “type”.
Reply
about 7 months ago
I get the same error message as above. Do you know what we can do??
Thanks!
Reply
about 5 months ago
Friend when i save the template the error looks like = “Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute “{1}” associated with an element type “type”.”
what to do plz… help
Reply
about 6 days ago
Awesome… The ERROR message (Open quote is expected for attribute “{1}” associated with an element type “type”.) in Blogger shows up because of simple reason:
replace:
with:
just the way the quotes are
Reply
August 31, 2010 - 2:27 pm
I got the same error :
“Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: Open quote is expected for attribute “{1}” associated with an element type “type”.”
i don’t understand the solution suggested:
replace:
with:
Reply
about 6 days ago
I was wondering if there is any way to have the drop down menu go horizontal instead of vertical?
Reply
about 6 days ago
how can i add mouse over menu to this blog pls tel me sir and i did try above but its not working pls tel me sir
vinaykumar G´s last blog ..
Reply
about 5 days ago
@ Linda-that doesn’t make sense.
I’m getting the same error message and don’t know what to do.
Reply