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


No comments: