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).


January 24th, 2009 at 7:27 am
hey congrats for such a good site and specially for this dock-menu. Now currently i have download your code and it works fine. Can you please do me a favour ? i want this menu in vertical and horizontal both manner. can you guide me for that ? waiting for your sooner reply.
Thanks again
January 23rd, 2009 at 10:00 am
Amazing stuff.But i want to customize it.I am in the process of building a classified ads site.On the front page i just want about 20 icons representing different categories.So i want to use this menu. but i am out of ideas how to customize it so that it takes the form of a big square on my sites front page rather than just a strip of icons on either the top or bottom.
January 20th, 2009 at 2:16 pm
Thanks, this is fantastic! Where’s the donate button? haha nvm, I found it!
Could you clear something up for me before I use this on a commercial site? I read the other day that apple has a copyright on the Dock or Dock effect, I doubt they heavily enforce this on websites, but could I potentially run into any trouble if I use this in my design? It is my website so I’m not worried about getting in trouble with a boss or someone that’s hired me, I’d just hate to get a letter from apple than have to redesign.
I find it quite ridiculous that such a basic UI effect could be copyrighted but then again we live in an age where corporations have more rights than people.
Anyways thanks again, you rock.
January 15th, 2009 at 4:32 am
i come from china this site is so good
January 13th, 2009 at 10:52 am
Also, when we click the menu items a red line frame is seen around it. where can I change this?
January 13th, 2009 at 10:34 am
hellow, this is amazing, I loved it. But a small problem occured while browsing with ie6. sizes of the images change in ie6. it looks like squized :o((( any help on this pls? in iepngfix.htc which code changes the sizes of the images? I couldn’t find unfortunately :o( it says auto for the sizes…any help pls? :o(((
January 7th, 2009 at 2:09 pm
Curious, is there a way to make this work vertically.
it is done with a different script here:
http://www.wizzud.com/jqDock/
but it’s response time is much slower and seems jumpy
January 4th, 2009 at 11:49 pm
that’s my fav object dock…
December 29th, 2008 at 5:47 pm
Hey, Thanks everyone here gets impresed by your menu. I’m using it on a Intranet Site :oD
December 24th, 2008 at 12:06 pm
be! I must say that I tried but I note that there is an error in two scripts!
how can I fix?
Incorrect scripts that I recommend computer (LA is WRONG PART IN CAPITAL):
$ (document). ready (
function ()
(
$ ( ‘# Dock2′). Fisheye (
(
Maxwidth: 60
items: ‘a’,
itemsText: ’span’,
container: ‘. container2-dock’,
itemWidth: 40
proximity: 80
alignment: ‘left’,
valign: ‘bottom’,
halign: ‘center’
)
)
)
);
and then the second script wrong:
$ (document). ready (
function ()
(
$ ( ‘# Dock2′). Fisheye (
(
Maxwidth: 60
items: ‘a’,
itemsText: ’span’,
container: ‘. container2-dock’,
itemWidth: 40
proximity: 80
alignment: ‘left’,
valign: ‘bottom’,
halign: ‘center’
)
)
)
);