April 26, 2013

How to add a FLYOUT menu to your blog

15:15 Posted by Veera Bhadra , , No comments
     Now that we have seen how to add drop down menu's to our blog...if you didn't ,go checkout that using the link provided. Sometimes we want menu on the left side like 'FLY OUT'  menu. So in this article we will show you how to add such fly out menu to our blog..

1) Open your Blogger dashboard click on the " TEMPLATE " button.

2) Now click on 'EDIT HTML' button beside 'Customize' button .

3)Now,click on Jump to widget on the top.

4)Click on the header and find </header> tag and paste the following code above it.


<div id='cssmenu'>
<ul>
 <li><a href='#'><span>Home</span></a></li>
  <li class='active has-sub'><a href='#'><span>Menu 1</span></a>
     <ul>
        <li class='has-sub'><a href='#'><span>Submenu 1</span></a>
            <ul>
               <li><a href='#'><span>Sub sub menu 1</span></a></li>
               <li class='last'><a href='#'><span>Sub sub menu 2</span></a></li>
            </ul>
           </li>
  <li class='has-sub'><a href='#'><span>SubMenu2</span></a>
             <ul>
                <li><a href='#'><span>Sub submenu 1</span></a></li>
                <li class='last'><a href='#'><span>Sub submenu 2</span></a></li>
             </ul>
          </li>
      </ul>
   </li>
   <li class='has-sub'><a href='#'><span>Services</span></a>
         <ul>
             <li><a href='#'><span>Products 1</span></a></li>
             <li class='last'><a href='#'><span>Products 2</span></a></li>
       </ul></li>
   <li><a href='#'><span>About</span></a></li>
   <li class='last'><a href='#'><span>Contact</span></a></li>
</ul>
</div>

If you want another menu  without sub menus ..copy the code

<li><a href='#'><span>About</span></a></li>

and add that change the name 'About' to your required name,and  '#' to your required link.
If you want menu with sub menu but without sub sub menus ...copy the code

<li class='has-sub'><a href='#'><span>Services</span></a>
         <ul>
             <li><a href='#'><span>Products 1</span></a></li>
             <li class='last'><a href='#'><span>Products 2</span></a></li>
       </ul></li>
And change names according to you.

If you want menu with sub menu and sub sub menus copy the code

<li class='active has-sub'><a href='#'><span>Menu 1</span></a>
     <ul>
        <li class='has-sub'><a href='#'><span>Submenu 1</span></a>
            <ul>
               <li><a href='#'><span>Sub sub menu 1</span></a></li>
               <li class='last'><a href='#'><span>Sub sub menu 2</span></a></li>
            </ul>
           </li>
  <li class='has-sub'><a href='#'><span>SubMenu2</span></a>
             <ul>
                <li><a href='#'><span>Sub submenu 1</span></a></li>
                <li class='last'><a href='#'><span>Sub submenu 2</span></a></li>
             </ul>
          </li>
      </ul>
   </li>
change names according to you.
Now we add styles :
4)Now search the following piece of code in your html  
                  "    ]]></b:skin>" 

and add the following code.

@charset 'UTF-8';

/* Flyout Menu */
#cssmenu {
  padding: 0;
  margin: 0;
  border: 0;
}
#cssmenu ul,
#cssmenu ul li,
#cssmenu ul ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#cssmenu ul {
  position: relative;
  z-index: 597;
  float: left;
}

#cssmenu ul li {
  float: left;
  min-height: 1px;
  line-height: 1em;
  vertical-align: middle;
}

#cssmenu ul li.hover,
#cssmenu ul li:hover {
  position: relative;
  z-index: 599;
  cursor: default;
}
#cssmenu ul ul {
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 598;
  width: 100%;
}

#cssmenu ul ul li {
  float: none;
}

#cssmenu ul ul ul {
  top: 1px;
  left: 99%;
}

#cssmenu ul li:hover > ul {
  visibility: visible;
}
#cssmenu ul ul {
  top: 1px;
  left: 99%;
}

#cssmenu ul li {
  float: none;
}

#cssmenu ul {
  font-weight: bold;
}

#cssmenu ul ul {
  margin-top: 1px;
}

#cssmenu ul ul li {
  font-weight: normal;
}
/* Custom CSS Styles */

#cssmenu {
  border-radius: 5px 0 0 5px;
  -moz-border-radius: 5px 0 0 5px;
  -webkit-border-radius: 5px 0 0 5px;
  background-color: #141414;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAyCAYAAACd+7GKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx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IE69Ar8wAAAABJRU5ErkJggg==);
  background-repeat: repeat-x;
  width: 200px;
}

#cssmenu:after {
  content: '';
  display: block;
  clear: both;
}

#cssmenu a {
  background-color: #141414;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAyCAYAAACd+7GKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjUwRTNGNUIzNDhBMjExRTI5MjY0Q0ZBRDcxOTYxNUNFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjUwRTNGNUI0NDhBMjExRTI5MjY0Q0ZBRDcxOTYxNUNFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTBFM0Y1QjE0OEEyMTFFMjkyNjRDRkFENzE5NjE1Q0UiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NTBFM0Y1QjI0OEEyMTFFMjkyNjRDRkFENzE5NjE1Q0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6JCXrGAAAANElEQVR42mIwMrL6z8TAwPAXlfiDyvqNykIjfqGyiCB+4uL+JMUUNMvRCDSHo3nrL0CAAQBzOzIE69Ar8wAAAABJRU5ErkJggg==);
  background-repeat: repeat-x;
  color: white;
  display: block;
  font-family: Helvetica, Arial, Verdana, sans-serif;
  font-size: 12px;
  font-weight: normal;
  line-height: 180%;
  padding: 13px 20px;
  text-decoration: none;
}

#cssmenu ul {
  border-right: 2px solid #f1f1f1;
  list-style: none;
  width: 200px;
}

#cssmenu > ul {
  float: left;
}

#cssmenu > ul > li:hover:after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  position: absolute;
  right: 0;
  top: 50%;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid #f1f1f1;
  margin-top: -10px;
}

#cssmenu > ul > li:first-child >a {
  border-radius: 5px 0 0 0;
  -moz-border-radius: 5px 0 0 0;
  -webkit-border-radius: 5px 0 0 0;
}

#cssmenu > ul > li:last-child >a {
  border-radius: 0 0 0 5px;
  -moz-border-radius: 0 0 0 5px;
  -webkit-border-radius: 0 0 0 5px;
}

#cssmenu > ul > li.active a {
  box-shadow: inset 0 0 3px black;
  -moz-box-shadow: inset 0 0 3px black;
  -webkit-box-shadow: inset 0 0 3px black;
  background-color: #070707;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAyCAYAAACd+7GKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5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9InIiPz6JCXrGAAAANElEQVR42mIwMrL6z8TAwPAXlfiDyvqNykIjfqGyiCB+4uL+JMUUNMvRCDSHo3nrL0CAAQBzOzIE69Ar8wAAAABJRU5ErkJggg==);
  background-repeat: repeat-x;
}

#cssmenu > ul > li:hover > a {

  background-color: #070707;
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAyCAYAAACd+7GKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjUwRTNGNUIzNDhBMjExRTI5MjY0Q0ZBRDcxOTYxNUNFIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjUwRTNGNUI0NDhBMjExRTI5MjY0Q0ZBRDcxOTYxNUNFIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTBFM0Y1QjE0OEEyMTFFMjkyNjRDRkFENzE5NjE1Q0UiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NTBFM0Y1QjI0OEEyMTFFMjkyNjRDRkFENzE5NjE1Q0UiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6JCXrGAAAANElEQVR42mIwMrL6z8TAwPAXlfiDyvqNykIjfqGyiCB+4uL+JMUUNMvRCDSHo3nrL0CAAQBzOzIE69Ar8wAAAABJRU5ErkJggg==);
  background-repeat: repeat-x;
  box-shadow: inset 0 0 3px black;
  -moz-box-shadow: inset 0 0 3px black;
  -webkit-box-shadow: inset 0 0 3px black;
}

#cssmenu .has-sub {
  z-index: 1;
}

#cssmenu .has-sub:hover > ul {
  display: block;
}

#cssmenu .has-sub ul {
  display: none;
  position: absolute;
  width: 150px;
  top: 5px;
  left: 100%;
}

#cssmenu .has-sub ul li {
  *margin-bottom: -1px;
}

#cssmenu .has-sub ul li a {
  background: #f1f1f1;
  border-bottom: 1px dotted #f7f7f7;
  color: #333333;
  filter: none;
  font-size: 11px;
  display: block;
  line-height: 120%;
  padding: 10px;
}

#cssmenu .has-sub ul li:hover a {
  background: #d8d8d8;
}

#cssmenu .has-sub .has-sub:hover > ul {
  display: block;
}

#cssmenu .has-sub .has-sub ul {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
}

#cssmenu .has-sub .has-sub ul li a {
  background: #d8d8d8;
  border-bottom: 1px dotted #e8e8e8;
}
5) Now you are done .Save template and see results.

Caution: IMPORTANT  Backup template if you are new to blogger.    
See how it looks like:

0 comments:

Post a Comment

Please Enter your comment here......