Showing posts with label DropDown. Show all posts
Showing posts with label DropDown. Show all posts

Tuesday, July 5, 2011

Jquery Smooth Navigation menu, DropDown Menus, MultiLvel DropDown Menu in Jquery, MultiLevel Menu on Click event

Smooth Navigation Menu is a multi level, CSS list based menu powered using jQuery that makes website navigation a smooth affair. And that's a good thing given the important role of this element in any site. The menu's contents can either be from direct markup on the page, or an external file and fetched via Ajax instead. And thanks to jQuery, a configurable, sleek "slide plus fade in" transition is applied during the unveiling of the sub menus. The menu supports both the horizontalvertical (sidebar) orientation. and

 This menu i found from Dynamic Drive Smooth Navigation Menu and used for multiple website.

because it provides the orientation based Menu. Means we can use this menu as HORIZONTAL and VERTICAL also.

But this menu is work on hover event.

By modifying its jquery I able to run it on click event.

 


Thursday, June 23, 2011

Multi Level CSS DropDownn, DropDown Menu, MiltiLevel menu, DropDown menu using CSS

Tomorrow I found an another Simple menu style which using CSS to create its drop down list and also it works upto 4 four level.

it use different  CSS style for this menu to work in IE6 using conditional CSS.

So I decided to put that complete code here so that my Designer friends can use and learn easily.


Head Code Section
<style type="text/css" media="screen, tv, projection">
/*<![CDATA[*/

/* page styling, unimportant for the menu. only makes the page looks nicer */
body {
 font-family: Calibri, "Trebuchet MS", sans-serif;
 font-size: 100%;
}

h1 {font-size: 2em;}
h2 {font-size: 1.5em;}

.example {
 background: #eee;
 padding: 50px;
}

/* - - - ADxMenu: BASIC styles [ MANDATORY ] - - - */

/* remove all list stylings */
.menu, .menu ul {
 margin: 0;
 padding: 0;
 border: 0;
 list-style-type: none;
 display: block;
}

.menu li {
 margin: 0;
 padding: 0;
 border: 0;
 display: block;
 float: left; /* move all main list items into one row, by floating them */
 position: relative; /* position each LI, thus creating potential IE.win overlap problem */
 z-index: 5;  /* thus we need to apply explicit z-index here... */
}

.menu li:hover {
 z-index: 10000; /* ...and here. this makes sure active item is always above anything else in the menu */
 white-space: normal;/* required to resolve IE7 :hover bug (z-index above is ignored if this is not present)
       see http://www.tanfa.co.uk/css/articles/pure-css-popups-bug.asp for other stuff that work */
}

.menu li li {
 float: none;/* items of the nested menus are kept on separate lines */
}

.menu ul {
 visibility: hidden; /* initially hide all submenus. */
 position: absolute;
 z-index: 10;
 left: 0; /* while hidden, always keep them at the top left corner, */
 top: 0;  /*   to avoid scrollbars as much as possible */
}

.menu li:hover>ul {
 visibility: visible; /* display submenu them on hover */
 top: 100%; /* 1st level go below their parent item */
}

.menu li li:hover>ul { /* 2nd+ levels go on the right side of the parent item */
 top: 0;
 left: 100%;
}

/* -- float.clear --
 force containment of floated LIs inside of UL */
.menu:after, .menu ul:after {
 content: ".";
 height: 0;
 display: block;
 visibility: hidden;
 overflow: hidden;
 clear: both;
}
.menu, .menu ul { /* IE7 float clear: */
 min-height: 0;
}
/* -- float.clear.END --  */

/* -- sticky.submenu --
 it should not disappear when your mouse moves a bit outside the submenu
 YOU SHOULD NOT STYLE the background of the ".menu UL" or this feature may not work properly!
 if you do it, make sure you 110% know what you do */
.menu ul {
 background-image: url(empty.gif); /* required for sticky to work in IE6 and IE7 - due to their (different) hover bugs */
 padding: 10px 30px 30px 30px;
 margin: -10px 0 0 -30px;
 /*background: #f00;*/ /* uncomment this if you want to see the "safe" area.
        you can also use to adjust the safe area to your requirement */
}
.menu ul ul {
 padding: 30px 30px 30px 10px;
 margin: -30px 0 0 -10px;
}
/* -- sticky.submenu.END -- */






/* - - - ADxMenu: DESIGN styles [ OPTIONAL, design your heart out :) ] - - - */

.menu, .menu ul li {
 color: #eee;
 background: #234;
}

.menu ul {
 width: 11em;
}

.menu a {
 text-decoration: none;
 color: #eee;
 padding: .4em 1em;
 display: block;
 position: relative;
}

.menu a:hover, .menu li:hover>a {
 color: #fc3;
}

.menu li li { /* create borders around each item */
 border: 1px solid #ccc;
}
.menu ul>li + li { /* and remove the top border on all but first item in the list */
 border-top: 0;
}

.menu li li:hover>ul { /* inset 2nd+ submenus, to show off overlapping */
 top: 5px;
 left: 90%;
}

/* special colouring for "Main menu:", and for "xx submenu" items in ADxMenu
 placed here to clarify the terminology I use when referencing submenus in posts */
.menu>li:first-child>a, .menu li + li + li li:first-child>a {
 color: #567;
}

/* Fix for IE5/Mac \*//*/
.menu a {
 float: left;
}
/* End Fix */

/*]]>*/
</style>



<!--  Conditional CSS for IE6 -->


<!--[if lte IE 6]>
<style type="text/css" media="screen, tv, projection">
/*<![CDATA[*/

/* - - - ADxMenu: IE6 BASIC styles [MANDATORY] - - - */

/*
 this rules improves accessibility - if Javascript is disabled, the entire menu will be visible
 of course, that means that it might require different styling then.
 in which case you can use adxie class - see: aplus.co.yu/adxmenu/examples/ie6-double-style/
 */
.menu ul {
 visibility: visible;
 position: static;
}

.menu, .menu ul { /* float.clear */
 zoom: 1;
}

.menu li.adxmhover {
 z-index: 10000;
}

.menu .adxmhoverUL { /* li:hover>ul selector */
 visibility: visible;
}

.menu .adxmhoverUL { /* 1st-level submenu go below their parent item */
 top: 100%;
 left: 0;
}

.menu .adxmhoverUL .adxmhoverUL { /* 2nd+ levels go on the right side of the parent item */
 top: 0;
 left: 100%;
}

/* - - - ADxMenu: DESIGN styles - - - */

.menu ul a { /* fix clickability-area problem */
 zoom: 1;
}

.menu li li { /* fix white gap problem */
 float: left;
 width: 100%;
}

.menu li li { /* prevent double-line between items */
 margin-top: -1px;
}

.menu a:hover, .menu .adxmhoverA {  /* li:hover>a selector */
 color: #fc3;
}

.menu .adxmhoverUL .adxmhoverUL { /* inset 2nd+ submenus, to show off overlapping */
 top: 5px;
 left: 90%;
}

/*]]>*/
</style>

<script type="text/javascript" src="ADxMenu.js"></script>
<![endif]-->



HTML Source Code
<div class="example">
        <ul class="adxm menu">
            <li><a href="#">Main menu:</a></li>
            <li><a href="#" title="My writings">Blog</a>
                <ul>
                    <li><a href="#">Home</a></li>
                    <li><a href="#feeds/">Feeds</a></li>
                    <li><a href="#archive/">Archive</a></li>
                </ul>
            </li>
            <li><a href="#adxmenu/" title="Nested fly-out menu, standard-compliant">ADxMenu</a>
                <ul>
                    <li><a href="#">1st submenu</a></li>
                    <li><a href="#adxmenu/">Overview</a></li>
                    <li><a href="#adxmenu/instructions/">Instructions</a></li>
                    <li><a href="#adxmenu/examples/">Examples</a>
                        <ul>
                            <li><a href="#">2nd submenu</a></li>
                            <li><a href="#adxmenu/examples/htb/">Top to bottom</a></li>
                            <li><a href="#adxmenu/examples/hbt/">Bottom to top</a>
                                <ul>
                                    <li><a href="#">3rd submenu</a></li>
                                    <li><a href="#">Item 2</a></li>
                                    <li><a href="#">Item 3</a></li>
                                    <li><a href="#">Item 4</a></li>
                                </ul>
                            </li>
                            <li><a href="#adxmenu/examples/vlr/">Left to right</a></li>
                            <li><a href="#adxmenu/examples/vrl/">Right to left</a></li>
                        </ul>
                    </li>
                    <li><a href="#adxmenu/trouble/">Troubleshooting</a></li>
                </ul>
            </li>
            <li><a href="#wch/" title="Windowed Controls Hider, for Win IE">WCH</a>
                <ul>
                    <li><a href="#wch/">Overview</a></li>
                    <li><a href="#wch/instructions/">Instructions</a></li>
                    <li><a href="#wch/examples/">Examples</a></li>
                    <li><a href="#wch/trouble/">Troubleshooting</a></li>
                </ul>
            </li>
            <li><a href="#lab/" title="Reusable web techniques">Lab</a>
                <ul>
                    <li><a href="#css/z-pos">z-index tutorial</a></li>
                    <li><a href="#css/forms/">Styling forms</a></li>
                    <li><a href="#css/cfl/">Centered frame layout</a></li>
                    <li><a href="#css/tabs2/">Tabs with variable height</a></li>
                    <li><a href="#css/nestedtabs2/">2-level navigation</a></li>
                    <li><a href="#css/ow/">Tabs: Overlapping Windows</a></li>
                    <li><a href="#scripts/windowopen/">Unobtrusive window.open</a></li>
                    <li><a href="#scripts/fif/">Floating iFrame</a></li>
                </ul>
            </li>
            <li><a href="#deliver/" title="Various sites I (co-)did">Delivered</a>
                <ul>
                    <li><a href="#deliver/sites/">Sites &amp; proof of concepts</a></li>
                    <li><a href="#deliver/wp/">WordPress goodies</a></li>
                </ul>
            </li>
            <li><a href="#about/" title="Relevant info about me">Colophon</a></li>
            <li><a href="#about/contact/">Contact me</a></li>
        </ul>
    </div>

JavaScript link
ADxMenu.js
 
 
 

Wednesday, June 1, 2011

jQuery MegaMenu Plugin with good animation effect and contact form | Multi Level DropDown using Jquery | Jquery Tutorial for MultiLevel Menu

while working as web designer adding menu to website is not an easy task.

Every time Client have some new requirements of data contain by his website.

Most of menu we found over the web are used to contain the text and link only. So if Client's want to show some of image into their menu is being a tough task because now clients want dynamic site due to easy handling of website.

Therefore I start searching for menu which can contain link and show images too and I found  Jquery Mega-Menu as a fabulous alternate of Menu.

It has good animation effect and we can put any thing in this menu from content to contact us form.

here I am sharing that beautiful and nice Menu Code to my Designer friends. It will be my pleasure if it helps someone.

Example


HTML Code


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jQuery MegaMenu Plugin - Version 2.0</title>
    <link rel="stylesheet" href="stylesheets/jquery.megamenu.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="stylesheets/example.css" type="text/css" media="screen" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript">
    </script>
    <script src="javascripts/jquery.megamenu.js" type="text/javascript"></script>
    <script type="text/javascript">
      jQuery(function(){
        var SelfLocation = window.location.href.split('?');
        switch (SelfLocation[1]) {
          case "justify_right":
            jQuery(".megamenu").megamenu({ 'justify':'right' });
            break;
          case "justify_left":
          default:
            jQuery(".megamenu").megamenu();
        }
      });
    </script>
  </head>
  <body>
  <table id="Page" cellspacing="0" cellpadding="0">
  <tr><td valign="top">
    <h1>jQuery MegaMenu Plugin Version 2.0</h1>
<!--MegaMenu Starts-->
    <ul class="megamenu">
      <li>
        <a href="javascript:void(0)">Tabular Content</a>
        <div style="width: 500px;">
          <h3>Tabular Content Example</h3>
          <table border="1" cellpadding="0" cellspacing="0" id="tabular-content">
            <tr>
              <th style="width: 15px">ID</th>
              <th>Name</th>
              <th>Place</th>
              <th style="width: 60px">Number</th>
            </tr>
            <tr>
              <td>1</td><td>Shiva Shankara Sahoo</td><td>Parlakhemundi</td><td>6742266</td>
            </tr>
            <tr>
              <td>2</td><td>Ravi Nikam</td><td>Brussels</td><td>5669985</td>
            </tr>
            <tr>
              <td>3</td><td>John Doe</td><td>Olympus</td><td>8699552</td>
            </tr>
            <tr>
              <td>4</td><td>Don Joe</td><td>Sinki</td><td>8877556</td>
            </tr>
          </table>
        </div>
      </li>
      <li>
        <a href="javascript:void(0)">Form Content</a>
        <div style="width: 265px;">
          <h3>Form Content Example</h3>
          <form action="#" method="get" id="form-content">
            <fieldset>
              <legend>Login</legend>
              <div class="FieldLabel">Login</div>
              <div class="FieldItem"><input type="text" class="Text" /></div>
              <div class="FieldLabel">Password</div>
              <div class="FieldItem"><input type="password" class="Text" /></div>
              <div class="FieldItem"><input type="button" value="Login" /></div>
            </fieldset>
          </form>
        </div>
      </li>
      <li>
        <a href="javascript:void(0)">List Content</a>
        <div style="width: 300px;">
          <ul id="list-content">
            <li>Point 1 is the first point
              <ul>
                <li>Point 1.1 goes here</li>
                <li>Point 1.2 goes here</li>
                <li>Point 1.3 can go here also</li>
              </ul>
            </li>
            <li>Point 2 is the second point
              <ul>
                <li>Point 2.1 is a sub point</li>
                <li>Point 2.2 is a sub point</li>
              </ul>
            </li>
            <li>Point 3 is the third point
              <ul>
                <li>Point 3.1 is a sub point</li>
                <li>Point 3.2 is a sub point</li>
              </ul>
            </li>
            <li>Point 4 is the lone fourth point without any children</li>
          </ul>
        </div>
      </li>
      <li>
        <a href="javascript:void(0)">Paragraph Content</a>
        <div style="width: 520px;">
          <p id="paragraph-content">
            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
          </p>
          <blockquote>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </blockquote>
        </div>
      </li>
      <li>
        <a href="javascript:void(0)">One Liner</a>
        <div style="width: 500px;">
          See how the position of the menu gets adjusted to stay within the outer bounds.
        </div>
      </li>
    </ul>
<!--MegaMenu Ends-->


    <div id="Links">
      <a href="index.html">MegaMenu Aligned to Left</a> |
      <a href="?justify_right">MegaMenu Aligned to Right</a>
    </div>




  </td></tr>
  </table>
  </body>
</html>



CSS Code



/*  Jquery MegaMenu CSS Start Here  */




body {
  font-family: "Arial";
  font-size: 13px;
  margin: 0px;
}
ul.megamenu {
  background-color: #888;
  border-top: 1px solid #888;
  border-bottom: 1px solid #666;
  margin: 0px auto;
  padding: 5px 10px;
  list-style: none;
  display: none;
}


ul.megamenu li.mm-item {
}


ul.megamenu li {
  margin: 0px;
  padding: 0px;
}


ul.megamenu li.clear-fix {
  float: none;
  clear: both;
  margin: 0px;
  padding: 0px;
  height: 0px;
  font-size: 0px;
  line-height: 0px;
}


ul.megamenu a.mm-item-link:link, ul.megamenu a.mm-item-link:visited {
  position: relative;
  display: inline-block;
  color: #FFF;
  padding: 8px 15px;
  margin: 0px 3px 0px 0px;
  text-decoration: none;
  z-index: 10;
  font-size: 14px;
  border-top: 1px solid transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}
*html ul.megamenu a.mm-item-link:link, *html ul.megamenu a.mm-item-link:visited {
  border-color: pink;
  filter: chroma(color=pink);
}


ul.megamenu a.mm-item-link-hover:link, ul.megamenu a.mm-item-link-hover:visited {
  color: #444;
  background: #FFF;
  border-top: 1px solid #777;
  border-left: 1px solid #777;
  border-right: 1px solid #777;
  -moz-border-radius: 3px 3px 0px 0px;
  border-radius: 3px 3px 0px 0px;
}


ul.megamenu div.mm-item-content {
  background: #FFF;
  padding: 0px;
  position: absolute;
  border: 1px solid #777;
  z-index: 9;
}


.mm-content-base {
  background: #FFF;
  position: relative;
  z-index: 11;
  padding: 10px;
}
.mm-js-shadow {
  background: #555;
  position: absolute;
  z-index: 10;
}  


/*  Jquery MegaMenu CSS Ends Here  */




/*  Example CSS Start Here  */
html, body {
  height: 100%;
}

#Page {
  width: 900px;
  border-left: 1px solid #CCC;
  border-right: 1px solid #CCC;
  margin: auto;
  border-collapse: collapse;
  height: 100%;
  -moz-box-shadow: 0px 0px 10px #888;
  -webkit-box-shadow: 0px 0px 10px #888;
}

#Links {
  padding: 15px;
  font-size: 16px;
  text-align: center;
}

h1 {
  font-family: Georgia;
  font-size: 22px;
  color: #333;
  margin: 0px;
  padding: 20px 15px;
}


ul.megamenu {
  background-image: url(../images/menu-background.gif);
  background-repeat: repeat-x;
  background-position: 0px 0px;
}

.mm-content-base {
  background-color: #FFF;
}

a:link, a:visited {
  color: #333;
}

a:hover {
  color: #666;
}


h3 {
  margin: 0px;
  font-size: 16px;
  padding: 5px 0px 2px;
  font-family: Georgia;
  font-style: italic;
  border-bottom: 1px solid #CCC;
  margin-bottom: 5px;
}

p, blockquote {
  margin: 0px;
  padding-top: 5px;
  padding-bottom: 5px;
}

blockquote {
  padding-left: 50px;
}

#tabular-content {
  border-collapse: collapse;
  border: 1px solid #265374;
  font-size: 12px;
  width: 480px;
}

#tabular-content td {
  padding: 4px 5px;
}

#tabular-content th {
  color: #FFF;
  background: #254156;
  padding: 5px;
}

#form-content {
  margin: 0px;
}
#form-content fieldset {
  border: 1px solid #CCC;
  margin: 0px;
  padding: 5px;
}
#form-content legend {
  font-size: 11px;
}
#form-content .FieldLabel {
  font-size: 11px;
}

#form-content .FieldItem {
  margin-bottom: 5px;
}

#form-content .FieldItem input.Text {
  width: 220px;
  border: 1px solid #AAA;
  outline: none;
  padding: 5px;
  font-size: 15px;
}


#list-content, #list-content ul {
  margin: 0px;
  padding-left: 20px;
}
#list-content li {
  margin: 0px;
  padding: 2px 0px;
}

#paragraph-content, #quote-content {
  text-align: justify;
}

/*  Example CSS Ends Here  */



JavaScript Library files

jquery Library File
jquery.megamenu.js


Live Example of Mega Menu


Tuesday, May 31, 2011

Sliding Menu Effect, Single Level Menu using Jquery, Jquery Tutorial for Sliding Effect

When we create Web pages there is a big roll of animation of menu.

here I am providing one of menu effect available in Javascript.






HTML CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sliding Menu Effect</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" language="javascript" 
 src="script.js"></script>
</head>
<body onload="menuSlider.init('menu','slide')">
<div class="menu">
    <ul id="menu">
        <li><a href="#">JavaScript</a></li>
<li><a href="#">Graphic Design</a></li>
        <li><a href="#">HTML</a></li>
        <li value="1"><a href="#">User Interface</a></li>
        <li><a href="#">CSS</a></li>
    </ul>
    <div id="slide"><!-- --></div>
</div>
</body>
</html>
 




CSS Classes
<style>
body {font:14px Helvetica, sans-serif; font-weight:bold; 
background:#FFF}
.menu {position:relative; background:url(images/bg.gif) no-repeat; 
height:35px; 
width:459px}
.menu ul {list-style:none; z-index:10; position:absolute; z-index:100; 
padding:9px 5px}
.menu li {float:left}
.menu a, .menu a:active, .menu a:visited {text-decoration:none; 
color:#FFF; 
padding:10px}
.menu a:hover {color:#ebf0e6}
#slide {position:absolute; bottom:0; height:4px; 
background:#89957a; z-index:10}
 </style>





JavaScript
<script>
var menuSlider=function(){
 var m,e,g,s,q,i; e=[]; q=8; i=8;
 return{
  init:function(j,k){
 m=document.getElementById(j); e=m.getElementsByTagName('li');
 var i,l,w,p; i=0; l=e.length;
 for(i;i<l;i++){
var c,v; c=e[i]; v=c.value; 
if(v==1){s=c; w=c.offsetWidth; p=c.offsetLeft}
 c.onmouseover=function(){menuSlider.mo(this)}; c.onmouseout=function()
{menuSlider.mo(s)};
 }
 g=document.getElementById(k); g.style.width=w+'px'; g.style.left=p+'px';
 },
 mo:function(d){
 clearInterval(m.tm);
 var el,ew; el=parseInt(d.offsetLeft); ew=parseInt(d.offsetWidth);
 m.tm=setInterval(function(){menuSlider.mv(el,ew)},i);
 },
 mv:function(el,ew){
 var l,w; l=parseInt(g.offsetLeft); w=parseInt(g.offsetWidth);
 
if(l!=el||w!=ew){
if(l!=el){
var ld,lr,li; ld=(l>el)?-1:1; 
lr=Math.abs(el-l); 
li=(lr<q)?ld*lr:ld*q; g.style.left=(l+li)+'px'}
if(w!=ew){
var wd,wr,wi; wd=(w>ew)?-1:1; 
wr=Math.abs(ew-w); 
wi=(wr<q)?wd*wr:wd*q; g.style.width=(w+wi)+'px'}
 }else{clearInterval(m.tm)}
}};}();
 
</script> 



Online Example