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.

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

634 comments so far

Pages: « 64 63 62 [61] 60 59 58 57 56 55 541 » Show All

  1. Gravatar
    Jorge
    # 604

    October 28th, 2008 at 9:49 am

    Hi
    It seems the code only work if I use 128×128 icons.
    How can I use 64×64 icons?
    Thanks

  2. Gravatar
    Rurikovi4
    # 603

    October 27th, 2008 at 2:33 pm

    Good!!!The best menu!!!I like this)))

  3. Gravatar
    Tanin
    # 602

    October 27th, 2008 at 1:59 pm

    It seems to have chrome issues regarding focus area. Other than that, it’s pretty smooth.

  4. 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/

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

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

  7. Gravatar
    Adrian
    # 598

    October 21st, 2008 at 8:51 am

    Works well with Safari!

  8. Gravatar
    Clubfreeware
    # 597

    October 19th, 2008 at 4:43 pm

    I had the same Problem!!!

  9. 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?

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

Pages: « 64 63 62 [61] 60 59 58 57 56 55 541 » Show All

Post your comment





Categories