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.
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 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 !
May 17th, 2007 at 12:59 am
This is really great, but it’s not very “accessible”….
May 16th, 2007 at 9:14 pm
gud day guys! has anyone use this code to the EXPONENTCMS?? Im a bit confuse in coding it..
OIiver
# 146
May 16th, 2007 at 4:35 am
@Nirke -
1) open zip
2) upload js/ and css/ folders to your server
3) include references to js and css in your document head (as in the example docs)
4) create an unordered list of links (as in the example docs)
5) include the $(document).ready(){…} call in the body at the end (as in the example docs)
Your tone could be a little less aggressive next time you ask for help: if there aren’t any instructions it’s because the examples could not be more self-explanatory.
WP has nothing to do with this.
Is there a website in converting the codes to a “smarty codes” w/c is use in the unordered list.tpl..??? ty
May 16th, 2007 at 5:50 pm
Wow! It’s wonderful.
Thanks so much.
May 16th, 2007 at 8:53 am
ok, this is VERY NICE !!
great job
May 16th, 2007 at 7:48 am
Very nice. :-)
May 16th, 2007 at 4:35 am
@Nirke -
1) open zip
2) upload js/ and css/ folders to your server
3) include references to js and css in your document head (as in the example docs)
4) create an unordered list of links (as in the example docs)
5) include the $(document).ready(){…} call in the body at the end (as in the example docs)
Your tone could be a little less aggressive next time you ask for help: if there aren’t any instructions it’s because the examples could not be more self-explanatory.
WP has nothing to do with this.
May 16th, 2007 at 2:33 am
Amazing!
I also wrote an article about it at my blog http://blog.akpix.de
May 16th, 2007 at 12:34 am
I’m a bit confused on where the coding goes in… Which actual file does the coding get added in???
May 15th, 2007 at 6:45 pm
a { outline: none }
You’ll want to include this in the CSS so firefox users don’t get that outline when they click on one of the links.