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

592 comments so far

Pages: « 6046 45 44 43 42 [41] 40 39 38 37 361 » Show All

  1. Gravatar
    Leo
    # 402

    January 26th, 2008 at 1:58 am

    hi, i was wondering if you can center this to the center of the page? if so, how?
    email me please. vdsleo@gmail.com

  2. Gravatar
    hasan
    # 401

    January 21st, 2008 at 5:48 am

    ı have problem in plesk domain controlor what can ı do for ı can play in plesks ?

  3. Gravatar
    Tonypm
    # 400

    January 20th, 2008 at 10:11 am

    Criticisms in some of the above comments are unfounded.

    1. how could implementing this be easier than downloading a zip file, unpacking into a folder and opening the html page in a browser. I have been looking at several implementations and this is the easiest and best described implementation of a dock menu I have found.
    2 Calling it a css menu is also reasonable, since the whole methodology of expanding and moving the images would not be possible without css capability.
    3. The js is beautifully small and compact.

    Well Done - Really cool

    Tonypm

  4. Gravatar
    Airad
    # 399

    January 18th, 2008 at 3:33 am

    I’v used it into my site,really great!

  5. Gravatar
    just
    # 398

    January 17th, 2008 at 9:42 am

    Amazing style

  6. Gravatar
    Andre NR
    # 397

    January 14th, 2008 at 4:54 am

    Amazing! What more can I say

  7. Gravatar
    Mickey
    # 396

    January 13th, 2008 at 10:28 am

    where to get more those Orange icon`s? :) great job!

  8. Gravatar
    Snap
    # 395

    January 12th, 2008 at 1:40 pm

    Work very rare in Safari
    Work in Opera, but horrible
    In IE and FF works good

    anyway thx !!

  9. Gravatar
    Enrique
    # 394

    January 7th, 2008 at 10:49 pm

    I found some flickering with IE 6. The suggestion in the following page fixed the problem.

    http://www.mister-pixel.com/#Content__state=is_that_simple

    Added the following for IE:
    try { document.execCommand(”BackgroundImageCache”, false, true);
    } catch(err) {}

  10. Gravatar
    demi
    # 393

    January 4th, 2008 at 4:01 am

    Great Work!!! Can I use it to my personal website?!!

Pages: « 6046 45 44 43 42 [41] 40 39 38 37 361 » Show All

Post your comment





Categories