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: « 73 72 [71] 70 69 68 67 66 65 64 631 » Show All

  1. Gravatar
    Orlando Fernandes
    # 701

    June 24th, 2009 at 5:40 am

    Killer menu, will use it on my site! Thanks!

  2. Gravatar
    Xiu
    # 700

    June 23rd, 2009 at 11:42 pm

    Hello there I’m not sure if you’re taking any questions for this anymore since you said you’re not.

    But it seems like the download document is broken. Or is it just my problem? Can you please check it >

  3. Gravatar
    Guilherme
    # 699

    June 19th, 2009 at 8:47 am

    Why this scroll with the page?
    In the Bottom view if the container,if the page is bigger to need a scroll, the menu follows the scroll.
    Have some fix to that?

  4. Gravatar
    Chris
    # 698

    June 16th, 2009 at 3:42 am

    I wish it worked with a scrolling page :(

    BUG! When setting #dock2 position (CSS) to “fixed”, scroll down the page, the component does not work properly. The mouse sensing area is invisible, not in html and not in CSS.

    JS is packed and can’t update ! Damn :( !

  5. Gravatar
    Lorena
    # 697

    June 10th, 2009 at 8:53 am

    Really cool and easy to use, thanks!

  6. Gravatar
    jason
    # 696

    June 8th, 2009 at 3:27 pm

    Its unfortunate that this is not really done as a more generic jquery plugin. The mechanics of the bar are done really well… just to much of a pain to customize.

  7. Gravatar
    ismadman
    # 695

    June 7th, 2009 at 4:53 am

    Just use the bottom dock in your css top dock code instead of the top dock

  8. Gravatar
    djerba
    # 694

    June 6th, 2009 at 3:34 pm

    Cool :)
    I’m late ! I tried the demo using Google Chrome.
    Everything is nice. But, in the example css-dock.html the bottom menu doesn’t work :(

    I will try to fix this bug !

  9. Gravatar
    bolo
    # 693

    June 5th, 2009 at 7:52 am

    a good navigation menu,it’s wonderful!

  10. Gravatar
    A R
    # 692

    June 4th, 2009 at 3:30 pm

    I loved the floiedity of this bar.
    I also found a code example in
    www.coderun.com/ide/?p=dock_menu

    is alows you for a play-in-code enviroment

    lot’s of fun :)

Pages: « 73 72 [71] 70 69 68 67 66 65 64 631 » Show All

Post your comment