Today I prepared nice CSS3 bottom navigation menu for you. This is will sliding drop down menu with fixed position in bottom of screen. Also, I going to use jQuery for sliding effects.
Here are final result (what we will creating):

Here are samples and downloadable package:
Ok, download the example files and lets start coding !
Step 1. HTML
Here are html source code of our page with menu. Whole menu built on UL-LI elements.
index.html
04 | <meta charset="utf-8" /> |
05 | <title>CSS3 Bottom navigation menu | Script Tutorials</title> |
07 | <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen"> |
08 | <link rel="stylesheet" href="css/menu.css" type="text/css" media="screen"> |
13 | <script type="text/javascript" src="js/jquery-1.5.2.min.js"></script> |
14 | <script type="text/javascript" src="js/script.js"></script> |
17 | <div class="menuContent"> |
18 | <a class="slider"><img alt="" id="bot" src="images/arrow_bottom.png"></a> |
20 | <li><a href="#"><img src="images/t1.png" /> Home</a></li> |
23 | <li><a href="#"><img src="images/empty.gif" />Link 1</a></li> |
24 | <li><a href="#"><img src="images/empty.gif" />Link 2</a></li> |
25 | <li><a href="#"><img src="images/empty.gif" />Link 3</a></li> |
26 | <li><a href="#"><img src="images/empty.gif" />Link 4</a></li> |
27 | <li><a href="#"><img src="images/empty.gif" />Link 5</a></li> |
29 | <a href="#" class="sub" tabindex="1"><img src="images/t2.png" />HTML/CSS</a> |
33 | <li><a href="#"><img src="images/empty.gif" />Link 6</a></li> |
34 | <li><a href="#"><img src="images/empty.gif" />Link 7</a></li> |
35 | <li><a href="#"><img src="images/empty.gif" />Link 8</a></li> |
36 | <li><a href="#"><img src="images/empty.gif" />Link 9</a></li> |
37 | <li><a href="#"><img src="images/empty.gif" />Link 10</a></li> |
39 | <a href="#" class="sub" tabindex="1"><img src="images/t3.png" />jQuery/JS</a> |
41 | <li><a href="#"><img src="images/t2.png" />PHP</a></li> |
45 | <h2>CSS3 Bottom navigation menu</h2> |
Step 2. CSS
Here are the CSS styles of our menu. Maybe you’ve noticed – that in our html – I have two CSS files: layout.css and menu.css. The first file (layout.css) contain the styles of our test page. We will not publish these styles in this article, but if you wish – you can find these styles in the package.
02 | background-color:#FFF; |
03 | background-image: -moz-linear-gradient(center top, #FFF, #FFF, #FFF, #ddd); |
04 | background-image: -webkit-gradient(linear, center top, center bottom, from(#FFF), color-stop(0.5, #FFF), to(#ddd)); |
05 | border:1px solid #C7C7C7; |
12 | -moz-border-radius-topright: 10px; |
13 | -moz-border-radius-topleft: 10px; |
14 | border-top-right-radius: 10px; |
15 | border-top-left-radius: 10px; |
16 | -moz-box-shadow: 3px -3px 5px #B8B8B8; |
17 | -webkit-box-shadow: 3px -3px 5px #B8B8B8; |
18 | box-shadow: 3px -3px 5px #B8B8B8; |
21 | .menuContent a.slider { |
22 | background-color:#fff; |
23 | background-image: -moz-linear-gradient(center top , #ddd, #FFF); |
24 | background-image: -webkit-gradient(linear, center top, center bottom, from(#ddd), to(#FFF)); |
25 | border: 1px solid #C7C7C7; |
30 | margin:-15px 30px 0 0; |
35 | -moz-border-radius-topright: 7px; |
36 | -moz-border-radius-topleft: 7px; |
37 | border-top-right-radius: 7px; |
38 | border-top-left-radius: 7px; |
39 | -moz-box-shadow: 3px -2px 3px #B8B8B8; |
40 | -webkit-box-shadow: 3px -2px 3px #B8B8B8; |
41 | box-shadow: 3px -2px 3px #B8B8B8; |
44 | .menuContent a.slider img { |
53 | display: inline-block; |
58 | border: 1px solid #ccc; |
66 | -moz-border-radius-bottomright: 10px; |
67 | -moz-border-radius-topleft: 10px; |
68 | border-bottom-right-radius: 10px; |
69 | border-top-left-radius: 10px; |
72 | #nav li a:hover, #nav li a.active { |
73 | background-color:#ddd; |
88 | vertical-align: middle; |
92 | background: url("../images/bulb.png") no-repeat; |
97 | vertical-align:middle; |
Step 3. jQuery
Finally, here are a little of JS code for our menu (for different slide effects).
js/script.js
02 | $('.slider').click(function () { |
03 | $('#nav').slideToggle(300); |
05 | var img = $(this).find('img'); |
06 | if ($(img).attr('id') == 'bot') { |
07 | $(img).attr('src', 'images/arrow_top.png'); |
08 | $(img).attr('id', 'top'); |
10 | $(img).attr('src', 'images/arrow_bottom.png'); |
11 | $(img).attr('id', 'bot'); |
15 | $('.sub').click(function () { |
16 | var cur = $(this).prev(); |
17 | $('#nav li ul').each(function() { |
18 | if ($(this)[0] != $(cur)[0]) |
21 | $(cur).slideToggle(300); |
Step 4. Images
Last step – used images:
Conclusion
Hope you enjoyed with our new css3 bottom sliding menu, don’t forget to tell thanks and leave a comment
Good luck!