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: « 7366 65 64 63 62 [61] 60 59 58 57 561 » Show All

  1. Gravatar
    Cau
    # 601

    October 23rd, 2008 at 8:56 am

    Here is a other version of the same thing, without jQuery or other libraries:
    http://www.dhteumeuleu.com/run/s-dock/

  2. Gravatar
    Greg K
    # 600

    October 23rd, 2008 at 5:48 am

    I’d actually like to know if there is a call for centered v-align. The vertical centering as it is in this url - [ui.jquery.com/demos]
    Thanks so much for the jquery plug.

  3. Gravatar
    Vladimir
    # 599

    October 22nd, 2008 at 4:56 am

    This looks very nice!

    Just to point out a bug, I guess, as it acts kinda funny in Google Chrome. The top menu works fine, while the bottom menu doesn’t do the fish eye effect. When using the top menu, the bottom one mimics fish eye behavior of the top menu simultaneously. Weird :)

  4. Gravatar
    Adrian
    # 598

    October 21st, 2008 at 8:51 am

    Works well with Safari!

  5. Gravatar
    Clubfreeware
    # 597

    October 19th, 2008 at 4:43 pm

    I had the same Problem!!!

  6. Gravatar
    robm
    # 596

    October 16th, 2008 at 3:12 pm

    great work!

    however I have a problem. I want to start dock from left not centered. I changed halign : ‘center’ and sth is wrong: the biggest icon isn’t under my cursor:
    http://img511.imageshack.us/my.php?image=dockfo6.png
    this is FF3, bug?

  7. Gravatar
    Ben
    # 595

    October 14th, 2008 at 2:49 pm

    Hi,

    I’ve integrated and arranged my own version of this CSS menu on my website. It floats and follows the user from top to bottom. I’ve found it hard to make it work on many different browsers. Does it work well for you all?

    http://www.sites-web.info/home.php

  8. Gravatar
    DarcH
    # 594

    October 14th, 2008 at 12:18 pm

    I integrated it into PHP-Fusion and works excellent! Thank you!

  9. Gravatar
    Gurpreet
    # 593

    October 13th, 2008 at 9:00 am

    Well, your fisheye menu is damn good, but a problem with it is that is starts even if mouse cursor is a bit far away. It would be good if you look at the one made available at http://marcgrabanski.com/pages/code/fisheye-menu

  10. Gravatar
    oviyen
    # 592

    October 8th, 2008 at 8:40 am

    This is really awesome. I am searching for stuffs like this for my art work portal. :) Its really good.

Pages: « 7366 65 64 63 62 [61] 60 59 58 57 561 » Show All

Post your comment