N.Design Studio

CSS Dock Menu

Filed in: Design, Mac Jump to comments

CSS dock menu

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

721 comments so far

Pages: « 7311 10 9 8 7 6 5 4 [3] 2 1 » Show All

  1. Gravatar
    louis
    # 21

    May 8th, 2007 at 7:32 pm

    very nice! i was looking to use the fisheye effect from Dojo framework but it was massive. this offering from Interface is pretty lightweight at only 30k.. i shall be implementing this into my site aty some point. good tutorial dude.. keep up the good work

  2. Gravatar
    Ponyboy
    # 20

    May 8th, 2007 at 7:28 pm

    Very impressive!

  3. Gravatar
    Chris Lorensson
    # 19

    May 8th, 2007 at 7:23 pm

    honestly- that’s amazing! once the Safari bugs are worked out I’ll definitely be using this! (note: many of my users are on Firefox 1.5 as well)

  4. Gravatar
    Matty
    # 18

    May 8th, 2007 at 7:23 pm

    That is siiiiickkk! I’ll be sure to use it soonish ;)

  5. Gravatar
    Shane
    # 17

    May 8th, 2007 at 7:22 pm

    Very nice! Absolutely amazing effect, thanks for sharing!

  6. Gravatar
    CSS
    # 16

    May 8th, 2007 at 7:12 pm

    Looks very very nice. Good luck with the Digg!

  7. Gravatar
    Tubby
    # 15

    May 8th, 2007 at 7:08 pm

    works in CAMINO Version 2007022310 (1.1b)

  8. Gravatar
    Jim
    # 14

    May 8th, 2007 at 6:25 pm

    Very nice! Lots of good things to say.

    Only bad thing is it’s very CPU intensive, so it might not work well if your processor is doing other things at the same time like encoding some media.

    I tried reading the javascript to offer suggestions on optimizing it, but found it was not written with a human in mind :)

  9. Gravatar
    Christopher
    # 13

    May 8th, 2007 at 5:56 pm

    The top menu of your demo has 2 orange “rss “links, whilst the bottom has 1 “rss” plus the “links” link, not that important, but still worth fixing for the demo in my opinion ;)

  10. Gravatar
    Hmm
    # 12

    May 8th, 2007 at 5:55 pm

    somebody else ripped of your site
    http://www.northshock.com/blog/

Pages: « 7311 10 9 8 7 6 5 4 [3] 2 1 » Show All

Post your comment