Drop 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 Design->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:
5. Just place the following code before the code above.
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;
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 Design>Page Elements
b.Then click on Add Gadget
c. Then select HTML/JAVASCRIPT
d.Then Add the Following code
onmouseout="mclosetime()">Home
onmouseover="mcancelclosetime()"
onmouseout="mclosetime()">
HTML Drop Down
DHTML Menu
JavaScript DropDown
Cascading Menu
CSS Horizontal Menu




Tidak ada komentar:
Posting Komentar