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

622 comments so far

Pages: « 6335 34 33 32 31 [30] 29 28 27 26 251 » Show All

  1. Gravatar
    steve M
    # 292

    September 7th, 2007 at 2:47 am

    wow this is great and amazing design.
    http://www.vividads.com.au

  2. Gravatar
    Jimmy
    # 291

    September 6th, 2007 at 4:27 pm

    Very nice. I will use this on my website. Very nice. I am new to web development and I appreciate such good examples to learn with.

    Jimmy

  3. Gravatar
    SURF
    # 290

    September 4th, 2007 at 10:57 pm

    GOOD顶

  4. Gravatar
    Christo
    # 289

    August 31st, 2007 at 12:39 am

    Yeah Awsome but if the user hasn’t got Javascript enabled it degrades terribly!
    Email me if you have a fix for that! And I’ll be impressed!

  5. Gravatar
    Alejandro
    # 288

    August 30th, 2007 at 2:52 pm

    hi how i can block the menu in the botton of the page when the page have scrolling bar…… thanks

  6. Gravatar
    Search Scripts
    # 287

    August 27th, 2007 at 1:59 am

    This is one of the best examples of CSS and JavaScript. Absolutely perfect! By the way, this website is very nice and colorful too.

  7. Gravatar
    Zach
    # 286

    August 26th, 2007 at 8:56 pm

    kury,

    If you put a the start of your javascript call:

    jQuery.noConflict();

    Then replace all the dollar signs with jQuery, you should be good!

  8. Gravatar
    Zach
    # 285

    August 26th, 2007 at 8:53 pm

    kury,

    If you put a the start of your javascript call:

    Then replace all the dollar signs with jQuery, you should be good!

  9. Gravatar
    cor
    # 284

    August 22nd, 2007 at 3:29 pm

    easy to overlook … http://interface.eyecon.ro/ for interface and jQuery uncompressed

  10. Gravatar
    kury
    # 283

    August 22nd, 2007 at 1:33 pm

    It’s pretty but couldn’t you have not used the $ function so that it was compatible with things like scriptaculous and lightbox aka anything that used the most popular javascript helper out there, prototype? or at least not have encrypted it so that I could have fixed it?

    Currently the only fix i could find for this is to replace the $ function with something like $prot in prototype and all your other prototype using tools (scriptaculous, lightbox).

    (note: Using replace all in your editor will replace some regular expressions that use the $ so be careful.)

    Great tool btw.

Pages: « 6335 34 33 32 31 [30] 29 28 27 26 251 » Show All

Post your comment





Categories