CSS Dock Menu
May 8th, 2007 Filed in: Design, Mac Jump to comments
If you are a big Mac fan, you will love this CSS dock menu that I designed. It is using Jquery Javascript library and Fisheye component from Interface and some of my icons. It comes with two dock styles - top and bottom. This CSS dock menu is perfert to add on to my iTheme. Here I will show you how to implement it to your web page.
Update: I no longer support the questons regard this script. If you like the HiGloss icons used in the demos, you can get them as stock icons at IconDock.
Download CSS Dock Menu
(View Demo)
Zip package included JS, CSS, and icons
1. Download source files
Download the CSS dock menu zip package.
2. Insert code
In between the HTML <head> tag, add the following code
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/interface.js"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 7]>
<style type="text/css">
.dock img { behavior: url(iepngfix.htc) }
</style>
<![endif]–>
The first part is the Javascript, second part is CSS stylesheet, and last part is the PNG hack for IE 6.
3. Configuration
Don’t forget to add the following code to anywhere within the <body> tag:
<script type="text/javascript">
$(document).ready(
function()
{
$(’#dock2′).Fisheye(
{
maxWidth: 60,
items: ‘a’,
itemsText: ’span’,
container: ‘.dock-container2′,
itemWidth: 40,
proximity: 80,
alignment : ‘left’,
valign: ‘bottom’,
halign : ‘center’
}
)
}
);
</script>
4. Add or remove item
To add menu item to the top dock (note: span tag is after the img tag):
<a class="dock-item" href="#"><img src="images/home.png" alt="home" /><span>Home</span></a>
To add menu item to the bottom dock (note: span tag is before the img tag):
<a class="dock-item2" href="#"><span>Home</span><img src="images/home.png" alt="home" /></a>
Browser Compatibility
I have tested on IE 6, IE 7, Opera 9, Firefox 2, and Safari 2 (although there are some minor rendering issues with Safari).


July 17th, 2009 at 9:33 am
CSS Dock rocks! I am going to use it!
July 15th, 2009 at 2:03 pm
I like big macs but i don’t see why i would love this…
July 7th, 2009 at 11:18 pm
Is it possible to nest another dock menu underneath the main menu? Kind of like a dropdown menu?
July 3rd, 2009 at 10:29 am
Its amazing… I never imagine there is stuff like this, I mean, its implemented in web..!
Great..!
^^
July 2nd, 2009 at 5:45 pm
hi, is there possibility to add spacing between icons with padding or margin? I have tried this and jquery ( or who ever) is hot calculating positions of mouse and icons correctly..is there a solution for this?
June 28th, 2009 at 2:07 pm
Hi there.
Thanks a lot for this exceptionally cool menus. We use them ALOT on our sites.
June 28th, 2009 at 1:27 am
How can we acheive to have multiple rows ( that is two horizontal menus one after another ) is it possible ???
June 26th, 2009 at 6:00 pm
I like it menu!!! Very nice work. Please, don’t forget to visit my Portal Of Web-Masters NullSpace.Ru
June 25th, 2009 at 4:10 am
Few questions:
1-can I generate a simple horizontal text sub-menu that will appear under a certain icon on the dock menu?
2-how can I get/create my own menu icons?
Thanks :-)
June 24th, 2009 at 11:38 am
can u add a submenu item to this? if so, how?