Kwicks for jQuery and an awesome horizontal animated menu

Kwicks for jQuery and an awesome horizontal animated menu


Spread it!

  • Share

Menu of a web page is the most important and maybe the most clicked link on your web page. Do you want your menu look sexy with an awesome animation on your website? Follow me, I will walk you to the final result of using Kwicks – jQuery Plugin to build an horizontal menu with a nice effect like Mootools but more customizable and versatile.

Always begin with the Demo and Download, huh?

Awesome horizontal animated menu

In the example above, the block width of menu item will be changed when the mouse goes over. This tut also show you how to work with css sprites – a popular css technique (not a new anymore, huh?).

HTML code:

HTML code seem to be simple. Simply copy and paste these all code below to your new HTML page.

<div class="kwicks_container">
 <ul class="kwicks">
 <li id="kwick_1">
   <a href="http://aext.net/" >Home
     <h3>Front page</h3>
  </a>
 </li>
 <li id="kwick_2">
   <a href="http://aext.net/category/css/">CSS & XHTML
     <h3>Makeup web page</h3>
  </a>
 </li>
 <li id="kwick_3">
   <a href="http://aext.net/category/java/">Java
     <h3>Learning Java</h3>
  </a>
 </li>
 <li id="kwick_4">
   <a href="http://aext.net/category/others">Others
     <h3>In the other hand</h3>
  </a>
 </li>
 <li id="kwick_5">
   <a href="http://aext.net/category/php/">PHP
     <h3>PHP Programming</h3>
  </a>
 </li>
 <li id="kwick_6">
   <a href="http://aext.net/category/resources/">Resources
     <h3>Resources for Web Developers</h3>
  </a>
 </li>
 <li id="kwick_7">
   <a href="http://aext.net/category/theme-layout/">Themes
     <h3>Bloggers - Wordpress Themes</h3>
  </a>
 </li>
 </ul>
</div>

CSS code:

The CSS code below maybe a bit long, but I think it’s easy to read. I separated the code into individual so that you can easy to customize later.

body, h3, div, ul, p {
    margin:0;
    padding:0;
}
body {
    background-color:#FFFF99;
    line-height:18px;
}

div.kwicks_container {
    width: 840px;
    margin: 100px auto 0 auto;
}

/*-------------------------KWICKS--------------------*/
.kwicks {
    list-style: none;
    position: relative;
    margin: 0;
    padding: 0;
    width:840px;
    height:50px;
    z-index:2;
}
.kwicks li {
    display: block;
    float: left;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    width: 100px;
    height: 35px;
    z-index:2;
    cursor:pointer;
    border-left-width: 1px;
    border-left-style: solid;
    border-left-color: #FF9933;
}
.kwicks li a {
    background-image:url(images/sprites_menu.png);
    background-repeat:no-repeat;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial;
    font-size: 14px;
    letter-spacing: -0.07em;
    color: #AA0000;
    height: 40px;
    outline:none;
    display:block;
    z-index:100;
    cursor:pointer;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: -3px;
    margin-left: 5px;
    text-decoration: none;
}
.kwicks li h3 {
    position: absolute;
    width: 120px;
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial;
    font-size: 10px;
    color: #FF6600;
    letter-spacing: -0.02em;
    outline:none;
    z-index:0;
    cursor:pointer;
    text-transform: uppercase;
    font-weight: normal;
    margin-left: 5px;
    text-decoration: none;
    left: 0px;
    top: 15px;
    right: 0px;
    bottom: 0px;
}
.kwicks li a:hover {
}
#kwick_1, #kwick_2, #kwick_3, #kwick_4, #kwick_5, #kwick_6, #kwick_7 {
    margin: 0pt;
    overflow: hidden;
    position: absolute;
    display: block;
    width: 120px;
}
#kwick_1 {
    left: 0px;
    border: none;
}
#kwick_2 {
    left: 120px;
}
#kwick_3 {
    left: 240px;
}
#kwick_4 {
    left: 360px;
}
#kwick_5 {
    left: 480px;
}
#kwick_6 {
    left: 600px;
}
#kwick_7 {
    right: 0px;
}
#kwick_1 a {
    background-position:0px 0px;
}
#kwick_1 a:hover, #kwick_2 #aktiv {
    background-position:0px 0px !important;
}
#kwick_2 a {
    background-position:0px -50px;
}
#kwick_2 a:hover, #kwick_2 #aktiv {
    background-position:0px -50px!important;
}
#kwick_3 a {
    background-position:0px -192px;
}
#kwick_3 a:hover, #kwick_3 #aktiv {
    background-position:0px -192px!important;
}
#kwick_4 a {
    background-position:0px -100px;
}
#kwick_4 a:hover, #kwick_4 #aktiv {
    background-position:0px -100px!important;
}
#kwick_5 a {
    background-position:0px -150px;
}
#kwick_5 a:hover, #kwick_5 #aktiv {
    background-position:0px -150px!important;
}
#kwick_6 a {
    background-position:0px -250px;
}
#kwick_6 a:hover, #kwick_6 #aktiv {
    background-position:0px -250px!important;
}
#kwick_7 a {
    background-position:0px -300px;
}
#kwick_7 a:hover, #kwick_6 #aktiv {
    background-position:0px -300px!important;
}

Javascript

Here is the list of javascript lib that we need to make the menu works

And ….

Copy & paste the hold thing below for the job done, but it’s just a little bit code I got. Put it in <head> tag:

<script type="text/javascript" src="javascript/jquery-1.2.3.js"></script>
<script type="text/javascript" src="javascript/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="javascript/jquery.kwicks-1.5.1.js"></script>
<script type="text/javascript">
      $().ready(function() {
        $('.kwicks').kwicks({
          max : 200,
          duration: 800,
          easing: 'easeOutQuint'
        });
      });
</script>

Read the Kwicks documentation for available options. See more …

One more thing

If you’re gonna use this menu for wordpress and want to select the active menu. Just do the simple way right below, all the css code you need has already put in css code at the middle of this tutorial. Edit something likes:

 .............
 <li id="kwick_1">
   <a href="http://aext.net/" id="active">Home
     <h3>Front page</h3>
  </a>
 </li>
 .............

Add the id attribute into the link with value: “active”. That’s it, and content inside <h3> tag is good for category decription, right?

Some words:

This tutorial only show you how to work with Kwicks and the method I’m using is the text only with one background. You can do the way with only background to make your menu cooler, because you can add effect to your text by images. Thanks for visiting. Enjoy it!

  • Digg This Post
  • Tweet This Post
  • Stumble This Post
  • Submit This Post To Delicious
  • Submit This Post To Reddit
  • Submit This Post To Mixx
  • Share on your Facebook
  • Submit this post to Dzone
  • Submit this post to Designbump
  • Submit this post to TheWebBlend

Author: Lam Nguyen

I'm Lam Nguyen, a 21 year old web developer writing about everything related to web design. I am owner of AEXT.NET and WhoFreelance.com Web Community News. You can catch me on twitter.


52 User Comments

  1. Dave Sparks 18. Aug, 2009 at 4:34 am #

    Like the effect plenty of CSS to go with it!

  2. Heem 18. Aug, 2009 at 11:30 am #

    Would be awesome if there were a drop down oprion on this to.

    • Lam Nguyen 18. Aug, 2009 at 11:56 am #

      I’m imaging how it would be if there were a drop down option :D

      • tperri 18. Aug, 2009 at 12:12 pm #

        oops replied to the wrong one Lam. :)

    • tperri 18. Aug, 2009 at 12:11 pm #

      Perhaps you should add dropdown functionality to it instead of hoping someone else will?

      • timmy 24. Sep, 2009 at 9:22 am #

        i’m trying to implement this but having trouble. I can get the dropdown to show using simple css (display:block on hover) but once I move mouse off from the button, the submenu disappears. I think it has something to do with the animate function used in jquery. Anyone got this working?

  3. aker 18. Aug, 2009 at 4:13 pm #

    sorry but:

    <a href=”http://aext.net/category/theme-layout/” rel=”nofollow”>Themes
    Bloggers – Wordpress Themes
    </a>

    You have lock-level elements (such as “”) inside an inline element

    <a> </a>

    • Lam Nguyen 18. Aug, 2009 at 4:37 pm #

      I’m sorry but I don’t get what you mean. Could you please tell more clearly?

  4. aker 18. Aug, 2009 at 5:04 pm #

    For Example:
    <a href=”http://aext.net/category/theme-layout/” rel=”nofollow”>Themes
    Bloggers – Wordpress Themes
    </a>

    Is not valid. You have Block Elements such h3 “inside” elements as A.

    <a href=”http://aext.net/category/theme-layout/” rel=”nofollow”>Themes</a>
    <a href=”http://aext.net/category/theme-layout/” rel=”nofollow”>
    Bloggers – Wordpress Themes
    </a>

    • Lam Nguyen 18. Aug, 2009 at 5:24 pm #

      Oh, yup. Sorry about that! H3 and A should be exchanged the position and the CSS need to be updated. Thanks!

  5. aBlogz 23. Aug, 2009 at 7:59 am #

    Good post.

    Thaks !

  6. Nurettin 26. Aug, 2009 at 6:23 am #

    i like it is

  7. thom 26. Aug, 2009 at 7:16 am #

    Wow, nice dude. Absolutely easy to include it and looks very nice!
    publish more :) !
    greez thom

  8. toty 27. Aug, 2009 at 5:14 am #

    I like this menu very much indeed.. very nice..! thanks

  9. Tim 14. Sep, 2009 at 3:22 pm #

    Look at my website homepage ive got it right there second column.
    Ive added spice with some gimpped images.PNG of course.
    My Site Homepage

    • Lam Nguyen 14. Sep, 2009 at 11:30 pm #

      Oh, it’s cool. You did well Tim. You’re using two of my tutorials and really did good two all.

  10. aya 22. Oct, 2009 at 9:12 am #

    I like this menu very much

    Can you use it with lightbox?

    • Lam Nguyen 22. Oct, 2009 at 11:13 am #

      @aya I can not imagine what the menu looks like when using with lightbox. What do you want to do with lightbbox?

  11. aya 22. Oct, 2009 at 5:26 pm #

    http://www.huddletogether.com/projects/lightbox2/

    I am javascript beginner.
    When it is an impertinent question, I’m sorry.

    • Lam Nguyen 22. Oct, 2009 at 7:28 pm #

      @aya I’m sorry. I know what you talking about lightbox, but I was confused about the implement. Did you mean when click on item in this Kwicks menu, the lightbox will display? If so, it’s not a menu anymore…

  12. aya 22. Oct, 2009 at 9:00 pm #

    It is not told to want to tell it.
    After English is studied, it questions more.

    thankyou so much

  13. dartagnanh 04. Nov, 2009 at 2:03 am #

    The ease with which this tutorial allows us to add this cool looking feature to a site makes me wanna spice up my site too. At the moment, it is just raw php. Maybe this will give it some more life. Thanks buddy.

  14. Faith 08. Nov, 2009 at 9:35 am #

    OK I dont get one thing, where is the code for those pics, in every tab, that reveales when mouse moves on?

    Thanks

    • Geler 25. Feb, 2010 at 8:44 am #

      There

      .kwicks li a {
      background-image:url(images/sprites_menu.png);

  15. questor 25. Nov, 2009 at 10:53 am #

    nice work ;
    but please how switch text & image ?
    i want see only image and onmouseover i want rollover text…
    thank you

  16. gautch 30. Nov, 2009 at 2:04 pm #

    Is there a way to have one of the menu items open by default?

    Something like when the page loads, the last menu item is in the hover state.

  17. Jens Wedin 09. Dec, 2009 at 2:20 am #

    Nice work! Like it but keyboard navigation would be really good for those that don’t use the mouse to navigate with.

  18. mpa 25. Jan, 2010 at 1:28 pm #

    How do I make active menu

  19. Lase 26. Jan, 2010 at 2:04 am #

    doesn’t work with i.e 6 png and png fix

  20. asd 26. Jan, 2010 at 11:01 am #

    Yeah, nice work man! Thanks a lot!

  21. shoaib hussain 07. Feb, 2010 at 2:42 am #

    thnx dude its reall nice,i guess i need to boookmark your blog,as you have so much to offer .thnx again
    shoaib hussain´s last blog ..Windows 7 Tip-Make System Restore Image My ComLuv Profile

Trackbacks/Pingbacks

  1. devmarks.com - 17. Aug, 2009

    Kwicks for jQuery and an awesome horizontal animated menu…

    [..]Menu of a web page is the most important and maybe the most clicked link on your web page[..]

  2. Kwicks for jQuery and an awesome horizontal animated menu | AEXT.NET - 18. Aug, 2009

    [...] Read this article: Kwicks for jQuery and an awesome horizontal animated menu | AEXT.NET [...]

  3. Kwicks for jQuery and an awesome horizontal animated menu | AEXT.NET « Netcrema - creme de la social news via digg + delicious + stumpleupon + reddit - 18. Aug, 2009

    [...] Kwicks for jQuery and an awesome horizontal animated menu | AEXT.NETaext.net [...]

  4. <!– vevni –> » links frescos para empezar el dia, jquery+javascript - 18. Aug, 2009

    [...] Kwicks for jQuery and an awesome horizontal animated menu [...]

  5. Twitted by media_dsign - 18. Aug, 2009

    [...] This post was Twitted by media_dsign [...]

  6. Twitted by ozrabal - 19. Aug, 2009

    [...] This post was Twitted by ozrabal [...]

  7. 30+ Fresh & Amazing jQuery Plugins & Tutorials - 19. Aug, 2009

    [...] 5. Awesome Horizontal Animated menu using Kwicks for jQuery [...]

  8. links for 2009-08-19 « sySolution - 19. Aug, 2009

    [...] Kwicks for jQuery and an awesome horizontal animated menu | AEXT.NET (tags: jquery menu navigation) [...]

  9. 30+ 新鲜惊奇的 jQuery 插件与教程 - 19. Aug, 2009

    [...] Awesome Horizontal Animated menu using Kwicks for jQuery 使用 jQuery Kwicks 插件建立一个可定制的,灵活的横向动画菜单。演示 | [...]

  10. CSS Brigit | Kwicks for jQuery and an awesome horizontal animated menu - 20. Aug, 2009

    [..] Kwicks for jQuery and an awesome horizontal animated menu…[..]

  11. 網站製作學習誌 » [Web] 連結分享 - 01. Sep, 2009

    [...] Kwicks for jQuery and an awesome horizontal animated menu [...]

  12. Lazy Web Designers » Blog Archive » 5 great javascripts for menus - 02. Sep, 2009

    [...] 1. Animated menu using Kwicks for jQuery [...]

  13. Really Useful Tutorials You Should Have Read in August 2009 | huibit05.com - 03. Sep, 2009

    [...] Kwicks for jQuery and an awesome horizontal animated menu By Lam Nguyen, August 17th, 2009 Site: AEXT [...]

  14. 15 Awesome Examples and Tutorials Slide Animated Menu | AEXT.NET - 20. Sep, 2009

    [...] Kwicks for jQuery and an awesome horizontal animated menu [...]

  15. 30+ JQuery Plugins And Tutorials | oOrch Blog - 25. Sep, 2009

    [...] 5.Awesome Horizontal Animated menu using Kwicks for jQuery [...]

  16. JQuery Script Sammlung | astBlog - 06. Nov, 2009

    [...] Link: http://aext.net/2009/08/kwicks-for-jquery-and-an-awesome-horizontal-animated-menu/ [...]

  17. Principio del Mundo » Blog Archive » Recursos jQuery - 24. Nov, 2009

    [...] Menú horizontal animado con jQuery [...]

  18. Kwicks – Horizontal Animated Menu - 04. Dec, 2009

    [...] Tutorial Tutorial and Documentation [...]

  19. 30+ 新鲜惊奇的 jQuery 插件与教程116 | 高手网 - 21. Jan, 2010

    [...] Awesome Horizontal Animated menu using Kwicks for jQuery 使用 jQuery Kwicks 插件建立一个可定制的,灵活的横向动画菜单。演示 | [...]

  20. 30+最新强大jQuery插件和教程 | 帕兰映像 - 25. Jan, 2010

    [...] 5. Awesome Horizontal Animated menu using Kwicks for jQuery [...]

  21. 30+ 新鲜惊奇的 jQuery 插件与教程 | 芒果 - 30. Jan, 2010

    [...] Awesome Horizontal Animated menu using Kwicks for jQuery 使用 jQuery Kwicks 插件建立一个可定制的,灵活的横向动画菜单。演示 | [...]

Leave a Reply

CommentLuv Enabled