Slick Drop down Menu with Easing Effect Using jQuery & CSS

Drop-down menus are an excellent feature because they help clean up a busy layout. When structured correctly, drop-down menus can be a great navigation tool, while still being an attractive design feature.

Continuing from “DAY2: Fading Background Color With jQuery .animate()“, today we would like to take a look at another effect that we can create using the .animate() function.

In this tutorial we’re going to be using the jQuery & CSS to create an attractive and functional dropdown menu. We’ll have a multilevel <ul>, which has a series of <li> elements each containing different blocks of <ul>. We are going to use jQuery to display the submenu items in and out of view.

Make sure to subscribe to our RSS Feed and follow us on Twitter to get updates on our new post series: jQuery .animate() function and what you can do with it.

Let’s have a sneak peak about what we are going to create today.

Check out the demo of “Slick Drop down Menu with Easing Effect With jQuery & CSS”.

Creating a Slick Drop down Menu with Easing Effect

Step1. HTML


First create an unordered list for your main top navigation. Then simply nest another unordered list for your sub navigation.

<ul class="blockeasing">
 <li class="main"><a href="#">About Us</a>
 <ul class="subnav">
 <li><a href="#">Overview</a></li>
 <li><a href="#">Products</a></li>
 <li><a href="#">Services</a></li>
 <li><a href="#">Why Us</a></li>
 </ul>
 </li>
 <li class="main"><a href="#">Products</a>
 <ul class="subnav">
 <li><a href="#">Main Product</a></li>
 <li><a href="#">DSL Lines</a></li>
 <li><a href="#">DialUps</a></li>
 <li><a href="#">Main Stream</a></li>
 </ul>
 </li>
 <li class="main"><a href="#">Contact Us</a>
 <ul class="subnav">
 <li><a href="#">Twitter</a></li>
 <li><a href="#">Email</a></li>
 <li><a href="#">LinkedIn</a></li>
 <li><a href="#">Facebook</a></li>
 </ul>
 </li>
</ul>

Step2. CSS

Now that the menu structure is in place we’ll add some styles to hide the sub navigation. Display must be set to none to the <ul> that carries the sub navigation items. This will ensure that the submenu is kept hidden when the mouse is not hovered on the block carrying the submenu.

ul.blockeasing {
 color:#CCCCCC;
 float:left;
 font-size:11px;
 padding:0;
 width:560px;
}
ul.blockeasing li{
 background:none repeat scroll 0 0 #333333;
 border:2px solid #000000;
 display:block;
 float:left;
 height:15px;
 list-style:none outside none;
 margin:0 5px;
 padding:5px 0px;
 text-align:center;
 text-shadow:0 1px 1px #000000;
 text-transform:uppercase;
 width:130px;
 position:relative;
}
ul.blockeasing li a{
 color:#CCCCCC;
}
ul.blockeasing li ul{
 background:none repeat scroll 0 0 #333;
 border-bottom:3px solid #DE93C3;
 float:left;
 padding:20px 5px 0;
 display: none;
 position:absolute;
 left:-50%;
 width:250px;
 margin-top:15px
 }
ul.blockeasing li ul li{
 border:none;
 border-bottom:1px solid #ccc;
 padding:5px;
 float:left;
 width:100px;
 overflow:hidden
 }

Step3. jQuery

The following script contains comments explaining which jQuery actions are being performed.

 $(document).ready(function() { 
 $("ul.blockeasing li.main").mouseover(function(){ //When mouse over ...
 	 //Following event is applied to the subnav itself (making height of subnav 60px)
		 $(this).find('.subnav').stop().animate({height: '60px', opacity:'1'},{queue:false, duration:1500, easing: 'easeOutBounce'})
		});
	 $("ul.blockeasing li.main").mouseout(function(){ //When mouse out ...
	 //Following event is applied to the subnav itself (making height of subnav 0px)
		 $(this).find('.subnav').stop().animate({height:'0px', opacity:'0'},{queue:false, duration:1600, easing: 'easeOutBounce'})
		}); 	
 //menu item background color animation			
		$("li").hover(function() {
 $(this).stop().animate({ backgroundColor: "#C13D93"}, 600);},
 function() {
 $(this).stop().animate({ backgroundColor: "#333333" }, 600);
 });		
});

Using the .stop() method before the animate() fixes the animation queue buildup where the animation will loop repeatedly by moving your mouse back and forth over the item.

Conclusion

The menu is a great addition to any interface; it’s easy for us to set up and easy for our visitors to use, it’s tactile and interactive and can be used in a variety of situations.

If you have suggestions or comments, feel free to let me know about it; I am still learning.

Check out the demo of “Slick Drop down Menu with Easing Effect With jQuery & CSS”.

Download Zip File.

To Be Continued on DAY 4…

Author: Noura Yehia

Noura Yehia is a Web Designer, Blogger and Creative Thinker. Founder of Noupe.com a popular blog about web design, tutorials, resources and inspiration. If you’d like to connect with her, you can follow her on Twitter or at her blog Devsnippets.

Article ,

41 Comments

  1. designfloat.com
    Apr 14, 2025 @ 04:51:47

    Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets…

    Drop-down menus are an excellent feature because they help clean up a busy layout. When structured correctly, drop-down menus can be a great…

    Reply

  2. Slick Drop down Menu with Easing Effect Using jQuery & CSS | Tutorialicious.info
    Apr 14, 2025 @ 08:09:19

    [...] View original post here: Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  3. Beben
    Apr 14, 2025 @ 08:51:37

    so smooth…cool

    Reply

  4. Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets « Netcrema - creme de la social news via digg + delicious + stumpleupon + reddit
    Apr 14, 2025 @ 09:26:31

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippetsdevsnippets.com [...]

    Reply

  5. Alex Fueras
    Apr 14, 2025 @ 11:21:21

    Really nice plugin. Thanks for sharing.

    Reply

  6. Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets » Web Design
    Apr 14, 2025 @ 12:35:05

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets [...]

    Reply

  7. wespai
    Apr 14, 2025 @ 19:13:23

    nice plugin

    Reply

  8. Slick Drop down Menu with Easing Effect Using jQuery & CSS | pro2go Designs Blog
    Apr 14, 2025 @ 20:37:24

    [...] Visit Source. [...]

    Reply

  9. Rose
    Apr 15, 2025 @ 00:20:41

    Love the post Noura, keep it up.

    All the best.

    Reply

  10. mil
    Apr 15, 2025 @ 01:46:08

    Nice plugin but it doesn’t work at IE

    Reply

  11. Napilink április 15 | hdesign
    Apr 15, 2025 @ 05:01:47

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets - Drop-down menus are an excellent feature because they help clean up a busy layout. When structured correctly, drop-down menus can be a great navigation tool, while still being an attractive design feature. [...]

    Reply

  12. Napi okosságok - 2025年04月15日 | Yloz féle zacc
    Apr 15, 2025 @ 14:53:56

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets [...]

    Reply

  13. woobill.com
    Apr 16, 2025 @ 00:43:23

    Slick Drop down Menu with Easing Effect Using jQuery & CSS | DevSnippets…

    Drop-down menus are an excellent feature because they help clean up a busy layout. When structured correctly, drop-down menus can be a great navigation tool, while still being an attractive design feature. Continuing from "DAY2: Fading Background Color…

    Reply

  14. sushilshirbhate
    Apr 16, 2025 @ 00:46:59

    Really nice plugin. Thanks for sharing.

    Reply

  15. Jordan Walker
    Apr 16, 2025 @ 07:25:40

    Beautiful and refreshing plug-in and contribution to the community. Thanks you very much.

    Reply

  16. Link Bytes 4.16.10 « SRSLYLIZ.COM
    Apr 16, 2025 @ 13:06:54

    [...] slick drop-down menu effect using jquery is hot to [...]

    Reply

  17. [jQuery] Creare un bellissimo menu a discesa con effetto easing! | sastgroup.com
    Apr 19, 2025 @ 04:01:26

    Reply

  18. Slick Drop down Menu with Easing Effect Using jQuery & CSS « RMDsite | Rich Media and Development Site Links and Resources
    Apr 19, 2025 @ 04:44:36

    [...] Direct Link [...]

    Reply

  19. Slick Drop down Menu with Easing Effect Using jQuery & CSS
    Apr 19, 2025 @ 07:08:22

    Reply

  20. Weekly Good Tweets - 04.12 - 04.17 « Tutvid News
    Apr 19, 2025 @ 19:54:54

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS: [...]

    Reply

  21. This Weeks Twitter Design News Roundup N.33 - Speckyboy Design Magazine
    Apr 20, 2025 @ 00:48:53

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  22. This Weeks Twitter Design News Roundup N.33 - Programming Blog
    Apr 20, 2025 @ 01:29:04

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  23. This Weeks Twitter Design News Roundup N.33 · rogdykker
    Apr 20, 2025 @ 01:48:01

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  24. This Weeks Twitter Design News Roundup N.33 | Forum on China Wholesale Lots
    Apr 20, 2025 @ 10:54:40

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  25. This Weeks Twitter Design News Roundup N.33 | DesignerLinks | Home to Web design news, jQuery Tutorials, CSS tutorials, Web Designing tutorials, JavaScript tutorials and more!
    Apr 20, 2025 @ 13:11:32

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  26. [jquery] creare un bellissimo menu a discesa con effetto easing!
    Apr 20, 2025 @ 18:21:37

    Reply

  27. freewebdev.jp
    Apr 22, 2025 @ 02:36:22

    jQueryを使ったオシャレなスリックダウンメニュー…

    「Slick Drop down Menu with Easing Effect Using jQuery & CSS」 ごちゃごちゃしたレイアウトを綺麗にしてくれるドロップダウンメニューのチュートリアルです。 適切に使用すれば素晴らしいナビゲーションとデザイン製を両立することが出来ます。 デモおよびファイルダウンロードも可能です。…

    Reply

  28. Drop down menu con le slick allentamento effetto utilizzando jQuery & CSS
    Apr 22, 2025 @ 04:25:50

    [...] Menu a discesa sono una caratteristica eccellente perché aiutano a ripulire un layout occupato. Quando strutturato correttamente, i menu drop-down può essere un ottimo strumento di navigazione, pur essendo una caratteristica attraente design. Continua da "DAY2: Fading colore di sfondo con jQuery. animare () ", oggi vogliamo dare un'occhiata a un altro effetto che si possa creare [. . . ] URL articolo originale http://devsnippets.com/article/slick-drop-down-menu-with-easing-effect-using-jquery-css.html [...]

    Reply

  29. This Weeks Twitter Design News Roundup N.33 « PsTrick
    Apr 22, 2025 @ 10:18:48

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  30. Weekly Design News - Resources, Tutorials and Freebies (N.34) - Speckyboy Design Magazine
    Apr 27, 2025 @ 02:00:15

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  31. Weekly Design News – Resources, Tutorials and Freebies (N.34) | DesignerLinks | Home to Web design news, jQuery Tutorials, CSS tutorials, Web Designing tutorials, JavaScript tutorials and more!
    Apr 27, 2025 @ 06:34:52

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  32. Weekly Design News – Resources, Tutorials and Freebies (N.34) « Film and entertainment
    Apr 27, 2025 @ 09:12:44

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  33. Weekly Design News – Resources, Tutorials and Freebies (N.34) | Forum on China Wholesale Lots
    Apr 27, 2025 @ 11:52:04

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  34. Weekly Design News – Resources, Tutorials and Freebies (N.34) | Master
    May 03, 2025 @ 21:44:15

    [...] Slick Drop down Menu with Easing Effect Using jQuery & CSS [...]

    Reply

  35. beninsky
    May 10, 2025 @ 18:37:41

    OK I discovered a bug that can happen RARELY but it is still annoying

    I made a video to show you: http://www.youtube.com/watch?v=Biv0GUR-C0w

    When I load the page for the first time and use the menu, if I leave my mouse cursor just on top of menu, then the menu close and immediatly after reopen...

    I removed the opacity option to show you the bug, opacity can be a solution, but I how can I do if I don’t want to add an opacity effet :S

    I FOUND THE SOLUTION: Add “overflow:hidden” into UL CSS Styles

    Here is the code:

    ul.blockeasing li ul.subnav{
    background:none repeat scroll 0 0 #333;
    border-bottom:2px solid #c13d93;
    float:left;
    padding:0px 5px 0;
    position:absolute;
    left:-50%;
    width:250px;
    margin-top:15px;
    height:0px;
    display:none;
    overflow:hidden;
    }

    Reply

  36. Pequeño Boss | 10 Jquery Menu Examples (Part 1)
    Feb 14, 2025 @ 15:23:42

    [...] Tutorial|View Demo [...]

    Reply

  37. jQuery and CSS Menus with Animations « Swadesh's Technology Blog
    Feb 19, 2025 @ 03:13:38

    [...] Slick Drop-Down Menu with Easing Effect Using jQuery & CSS Drop-down menus are an excellent feature because they help clean up a busy layout. When structured correctly, drop-down menus can be a great navigation tool: [...]

    Reply

  38. jQuery and CSS Menus with Animations « CSS Tips
    Feb 19, 2025 @ 03:35:05

    [...] Slick Drop-Down Menu with Easing Effect Using jQuery & CSSDrop-down menus are an excellent feature because they help clean up a busy layout. When structured correctly, drop-down menus can be a great navigation tool: [...]

    Reply

  39. jQuery Menu Tutorials, jquery tutorial | Designer
    Mar 03, 2025 @ 09:55:51

    [...] In this tutorial you will learn to create drop-down menus using jQuery. You can create well structured Drop-down menus and keep your site layout clean and tidy and still maintain an attractive design for your site. Download Source [...]

    Reply

  40. Free Dropdown jQuery Menu « Web css jquery
    May 24, 2025 @ 02:56:58

    [...] Read more [...]

    Reply

  41. Ali
    Oct 26, 2024 @ 13:50:33

    Very nice menu. Thanks.

    Reply

Leave a Reply Cancel

*

*

AltStyle によって変換されたページ (->オリジナル) /