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 to display probably in 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).

513 comments so far

Pages: « 5251 50 49 48 47 [46] 45 44 43 42 411 » Show All

  1. Gravatar
    cone crusher
    # 453

    March 13th, 2008 at 2:37 am

    This is definitely the best of all ! thanks for sharing.

  2. Gravatar
    jaw crusher
    # 452

    March 13th, 2008 at 2:36 am

    非常精彩,值得借鉴和推荐。
    这个特效加上唯美的页面设计会更炫!

  3. Gravatar
    Fooberichu
    # 451

    March 12th, 2008 at 9:37 am

    Saw other people asking but couldn’t see if it had been answered, any way to get this to dock on the left or right side of the browser?

  4. Gravatar
    sarak
    # 450

    March 11th, 2008 at 11:19 pm

    good.thanks.with great tutorial and code.

  5. Gravatar
    leesum
    # 449

    March 11th, 2008 at 5:03 am

    非常精彩,值得借鉴和推荐。
    这个特效加上唯美的页面设计会更炫!

  6. Gravatar
    Adam
    # 448

    March 9th, 2008 at 9:31 pm

    Bro, nice work :D congrats, can we put the dock in the left side? i mean, up to down. Like a list. Is it possible? Please write an email to me. Thx.

  7. Gravatar
    Andreas Elf
    # 447

    March 9th, 2008 at 8:13 am

    Hello from a MAC n00b. have used it for 4 days now :)
    Anyway this dock seems to work with Safari 3.
    When it comes to JavaScript disabled. just put a text that syas that the page are using a menu that needs JavaScript enabled.

  8. Gravatar
    raul
    # 446

    March 7th, 2008 at 10:23 pm

    hi, wonderful widget, how can i do this widget gets all the widht screen long, sorry for my english

  9. Gravatar
    Adam
    # 445

    March 6th, 2008 at 11:10 am

    Your script is great but doesn’t work with Javascript disabled… to assume everyone has this is stupid…. I will fix it though, no worries :)

  10. Gravatar
    Zachary
    # 444

    March 6th, 2008 at 12:35 am

    Apologize if this has already been said, but I couldn’t find any mention of it.

    The new version of JQuery fixes some of the Safari 3 problems. Download the “Packed” version, change the downloaded file’s name to “jquery.js” and replace the file in the “js” folder with the one you downloaded. Voila! It fixed all of the problems I was experiencing with testing, so hopefully it works for you too!

    Zach

Pages: « 5251 50 49 48 47 [46] 45 44 43 42 411 » Show All

Post your comment





Categories