Ph: 06222008

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

609 comments so far

Pages: [61] 60 59 58 57 56 55 54 53 52 511 » Show All

Gravatar
webtechnepal
# 609

November 6th, 2008 at 5:29 am

Thanks for the source code.

Gravatar
Jordan
# 608

November 1st, 2008 at 2:13 pm

BUG: (used Firefox 3.03 when I found this)

Move your cursor over the icon, then right click on it. You’ll see.

Gravatar
James
# 607

November 1st, 2008 at 12:19 pm

Hey, love the dock! Great work! Quick question, I’m combining this with a javascript to open movable, resizeable content windows. I can open as many windows as I want and everything works fine, but as soon as I minimize a window or close one, the fisheye for the dock stops working. Do you have any ideas why this would happen? I’m speculating that because your script is calling out a function that is “unnamed” and the other script is calling out “named” functions, that when the close or minimize functions are called out, it causes your script to stop working… (not that I’m blaming your script- please dont get the wrong idea!). I’d really appreciate any feedback I can get, both from you or from the community, thanks in advance!

Gravatar
Simon
# 606

October 29th, 2008 at 7:56 pm

This is a fantastic menu, but I do have a question.

Is there a way to reduce the area that activates the menus animation? I would love to use this as a second menu under a horizontal text menu but when using the text menu above the dock menu, it activates the animation of the dock menu.

Cheers, Simon

Gravatar
Joseph
# 605

October 29th, 2008 at 4:51 pm

Hi

I have LITTLE problem with dock-menu and SuperSleight solution for png transparency ( http://24ways.org/2007/supersleight-transparent-png-in-ie6 )

In Firefox, Opera, and others looks fine, but in IE 6 menu collapse ( http://www.fotosik.pl/pokaz_obrazek/pelny/c92edf675e89a983.html )

Any ideas? Why SuperSleight break down this wonderful menu?

Regards!
P.S. email in nick-name is correct

Gravatar
Jorge
# 604

October 28th, 2008 at 9:49 am

Hi
It seems the code only work if I use 128×128 icons.
How can I use 64×64 icons?
Thanks

Gravatar
Rurikovi4
# 603

October 27th, 2008 at 2:33 pm

Good!!!The best menu!!!I like this)))

Gravatar
Tanin
# 602

October 27th, 2008 at 1:59 pm

It seems to have chrome issues regarding focus area. Other than that, it’s pretty smooth.

Gravatar
Cau
# 601

October 23rd, 2008 at 8:56 am

Here is a other version of the same thing, without jQuery or other libraries:
http://www.dhteumeuleu.com/run/s-dock/

Gravatar
Greg K
# 600

October 23rd, 2008 at 5:48 am

I’d actually like to know if there is a call for centered v-align. The vertical centering as it is in this url - [ui.jquery.com/demos]
Thanks so much for the jquery plug.

Pages: [61] 60 59 58 57 56 55 54 53 52 511 » Show All

Post your comment






You are viewing a mobilized version of this site...
View original page here

How do you rate mobile version of this page?

Mobilized by Mowser Mowser