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: « 7371 70 69 68 67 [66] 65 64 63 62 611 » Show All

  1. Gravatar
    Anil Kumar
    # 651

    February 7th, 2009 at 7:06 am

    I am using this menu in my local website. I am facing a problem after including a label tag to display the menu name. Since the names are 10 to 20 character long, there is no enough spacing between the icons and looks congested. Can any one tell me how to increase the spacing between the icons?
    you can mail me at sysarcweb@gmail.com

  2. Gravatar
    JackMan
    # 650

    February 3rd, 2009 at 2:21 pm

    Please ! How Do You Change It SO That WHen I Click On A Icon It Leads Me To A URL?

  3. Gravatar
    JeRicHoOL
    # 649

    February 2nd, 2009 at 6:06 pm

    I want to use this for my phpBB forum. Can you or anyone else tell me how to install it there. Thanks in advance.

  4. Gravatar
    maran
    # 648

    February 2nd, 2009 at 8:59 am

    hi,

    That was not working in Apple Safari for windows.. please guide me.

    thanks
    maran

  5. Gravatar
    destrukt
    # 647

    January 30th, 2009 at 8:46 pm

    i just have a quick question on positioning.

    im having troubles with the docking on the bottom. as to i want the bar to stay on the bottom at all times when people are scrolling its “fixed” to that position on the screen. unfortunitly when i do that the proximity area is above the images of the dock bar. the bar works when the page is on the top but when u scroll down the page the dock bar follows but the “hover area” is still in its spot. do i have to do anything special to fix that?

  6. Gravatar
    Naresh
    # 646

    January 29th, 2009 at 10:06 am

    How can we show this icons vertically

  7. Gravatar
    Tom
    # 645

    January 29th, 2009 at 8:24 am

    I’ve found a solution to the Safari/Webkit problem. Its a Jquery problem where the onload (ready) functionalty starts running scripts before the CSS has loaded.

    To solve this, just remember to put all your scripts AFTER the CSS in the head of your document. This also applies for the demo of this script.

    Further info:
    http://dev.jquery.com/ticket/1319

  8. Gravatar
    Tom
    # 644

    January 26th, 2009 at 9:18 am

    Just noticed the Safari 3 bug, its definitely a bit of a show stopper. This is the problem where the hover area for the animation is stuck at the top of the screen, rather than at the bottom where the actual icons are placed.

    It seems to work at first and then break the second time you visit (or refresh), maybe there is some kind of caching problem.

  9. Gravatar
    Tom
    # 643

    January 26th, 2009 at 8:29 am

    Sorry, just noticed that this only seems to happen in Firefox 2.0 for OSX. Seems very smooth in Safari, IE6, Firefox 3.0.

    I disabled Firebug which seems to make it slightly better, but its still a little jerky. Since Firefox 3.0 is out I suppose it doesn’t really matter.

    Thanks.

  10. Gravatar
    Tom
    # 642

    January 26th, 2009 at 8:01 am

    Almost perfect. One small issue I have is that it seems a little jumpy, almost a bit too reactive to the movement of the mouse. So if your mouse movement is slightly juddery it reflects in the movement of the icons.

    Is there any way of ’smoothing’ the movement of the icons slightly, sort of like a max animation speed, easing in and out.

    Cheers.

Pages: « 7371 70 69 68 67 [66] 65 64 63 62 611 » Show All

Post your comment