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


May 19th, 2007 at 1:31 pm
I just really have to make this comment. I want to say that Nick has done lots of work on making people’s life easier especially in terms of blog designs. And I think it unfair when people just use his design and do super minor changes while still retaining the orginality of the blogtheme and then stating it as their own. If anything at least use the template as a learning curve and make your own, If not give the guy some credibility.
May 19th, 2007 at 11:15 am
Hey jAV, to change the links just replace the “#” with your link, in the html file. (Step 4 above)
May 18th, 2007 at 7:51 pm
hi, but how can i change the links? in which file.
May 18th, 2007 at 11:48 am
Wo cool!
May 18th, 2007 at 10:35 am
Wow, great job !! So nice.
Just one remark, in terms of accessibility :
Maybe it would be great if the menu was ok (without the effet of course) when javascript is disabled ..
Benjamin
May 18th, 2007 at 9:21 am
@Trisha
Not to be a troll, but to moan about the quality of the instructions and accessibility is pretty weird: this guy has published his code for your benefit. He’s under no obligation to hold your hand and your under no obligation to use it.
The code is *really* straightforward. If you don’t understand it make an effort to learn how it works. If you can’t be bothered to, don’t post.
May 18th, 2007 at 6:58 am
That’s insanely well done.
May 17th, 2007 at 2:51 pm
This is by far the WORST instructions ever given. You definitely might want to go into more detail here.
May 17th, 2007 at 2:20 pm
very cool, thanks!
May 17th, 2007 at 7:40 am
This is great and I’d really like to implement this as my main menu in my photography website !
I figured out most of the stuff that can be adjusted, although i really am a newbie at CSS and JS… I’m really kinda proud of myself…!
But I have one problem I can’t figure out:
Is there a way to adjust the spacing between the menu items…?
My temporary solution is to use pngs with transparent borders left and right, but I’d like to use jpgs and adjust the spacing between them in CSS…
Is there a way to accomplish this easily…?
Also:
If I move the mouse away from the menu very fast (so that the cursor is away from the proximity distance specified in the script), the menu stays expanded and looks kinda strange…
Is there a way to make the menu shrink itselt to the normal (unexpanded) state when the cursor moves away fast…?
Like in Isaac’s example in post 59…?
Some help would be very appreciated ! Thanks !