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: « 7372 71 70 69 68 [67] 66 65 64 63 621 » Show All

  1. Gravatar
    goodrunb
    # 661

    March 10th, 2009 at 10:44 pm

    @destrukt i have the same problem as you CAN ANYONE TELL ME HOW TO LOCK THE DOCK AT THE BOTTOM OF THE PAGE NO MATTER HOW I SCROLL

  2. Gravatar
    Jason
    # 660

    March 10th, 2009 at 2:18 pm

    @Tom (#645) - THANK YOU. that was driving me crazy, and no one else seemed to be able to find that answer.

  3. Gravatar
    Vector-Master
    # 659

    March 6th, 2009 at 6:02 am

    it’s realy so great but, i have a probleme with the png icons they show up with blue bg help me not transparente

  4. Gravatar
    matthias
    # 658

    March 5th, 2009 at 1:12 pm

    Hi,
    very nice work so far :)
    Is it possible to change the size of the distance of the Icons and the Icon size > except to set the css .dock-item2 img width to 123%, i really try out everthing i know, but i didn’t get it. Thanks for an advice.

    bests,
    matthias

  5. Gravatar
    James Mann
    # 657

    February 24th, 2009 at 5:49 am

    I am new to the whole CSS thing and am really excited about maybe using this apple style dock in one of my next web sites. I like it because it is something different.

    I notice some people, however, are having problems with the code side of it, which is slightly worrying but never-the-less i’ll give it a go.

    I’ll let you know how i get on and if i need any help….which may be likely. :)

  6. Gravatar
    Ruud Harmsen
    # 656

    February 22nd, 2009 at 8:37 am

    This is some really nice work man! Keep it up;)

  7. Gravatar
    goodrunb
    # 655

    February 20th, 2009 at 6:52 pm

    um i put it at the bottom of my page and it dosent do thee fish eye but when i move my mouse up to the top in a non dock area the fisheye activates help

  8. Gravatar
    Jan
    # 654

    February 13th, 2009 at 7:24 am

    is it possible to use this for a layered menu? i’m not that fluent in JS and CSS..
    so that an Nav-layer hovers over/under the selected menu item?

  9. Gravatar
    JeRicHoOL
    # 653

    February 7th, 2009 at 9:55 am

    EDIT: The code above “Browser Compatibility”. Scroll a bit up.

  10. Gravatar
    JeRicHoOL
    # 652

    February 7th, 2009 at 9:55 am

    JackMan, In the following code you have to replace the “#” with a link.

    Home

    ———-

Pages: « 7372 71 70 69 68 [67] 66 65 64 63 621 » Show All

Post your comment