Flickr horizontal menu
Posted on February 29th, 2008, by Cristian in Downloads, Tutorials, Xhtml & CSSI have start my menu from “Flickr like horizontal menu” and I improved it because it has a bug in the css. You can’t add more menu items on a line.This horizontal menu that I want to show is used also by many well know websites as Facebook, LinkedIn and Flickr.
I made a very nice, simple and useful menu, developed with jQuery. If we can use js framewords why not, jQuery it’s very easy to use for traversing the DOM. The menu can be very easy implement with Prototype, MooTools or basic javascript functions.
I’m open for comments and suggestion so please add your comment.


[…] can check also my Flickr menu, that is build also on […]
Hi Christian, thanks for this update! I’ll add a link at this post from the original post:
http://woork.blogspot.com/2008/01/flickr-like-horizontal-menu.html
Have a nice day.
Antonio.
I would like to close the submenu when I click outside the menu.
Do you how to do this ?
Thx
Hi Greg,
Here is the answer to your question. Just add the following lines at the end of the javascript code and before the $(document).ready is close:
$(document).click(function(event){ var target = $(event.target); if (target.parents("#nicemenu").length == 0) { $("#nicemenu span.head_menu").removeClass('active'); $("#nicemenu div.sub_menu").hide(); $("#nicemenu img.arrow").attr('src','arrow.png'); } });So, when you click outside the menu I check that is the click is not on elements that are in the menu.
I update also the tutorial demo!
Waouw. You’re Speedy Gonzales ;)
Thank you verry much.
You are welcome!
Everything is there to make a jquery plugi !
Thanks for the changes made for greg (my bro). It works great !
Yes, I will think to make a plugin. Looks that people are realy like the feature.
Simply wonderful! Thank you!
Did you comment that it can be implement with Prototype or Javascript. Please, can you paste the code in Javascript? Thus the menu doesn’t depent of any external library and will work in any proyect.
Many thanks and congratulations.
Hi and thanks again
There is a problem with the menu over any image under the submenu (with IE6 and IE7)
The menu is hidden by the image. Have tried a lot of css stuff (z-index,…).
Do you have any idea what the problem may be ?
I think the answer to your question is to change the z-index to the menu container (div.nicemenu). For example add the property” “z-index:100″ to div.nicemenu
Hello, following your suggestions, I write the same menu using DOM.
http://vicentgozalbes.com/2008/3/21/men-u-horizontal-al-estilo-flickr-o-facebook
Thanks.
[…] Flickr horizontal menu | Candes Projects | Cristian Neagu - Web designer, developer I have start my menu from Flickr like horizontal menu and I improved it because it has a bug in the css. You can’t add more menu items on a line.This (tags: code flickr menu navigation) […]
Hi, great work.
Does anyone converted this script to prototype? I don’t know how to do it :-)
Thanks a lot.
If you can wait one more week I can provide you the code with Prototype.
Wow. That would be perfect.
I can wait ;-)
Thx
Hi,
sorry. I don’t want to bother you. :-)
But do you already have a prototype-solution? Would be very nice of you. Thank you.
Hi, I ported your nice menu to prototype. Those interested can find it here http://igorstravinskij.blogspot.com/2008/04/flickr-horizontal-menu-with-prototype.html
Great! It looks good :)
What does this do? Why is it required?
http://code.jquery.com/jquery-latest.pack.js
It loads the latest version of jQuery.
Great script, I love it… But how can I change the fade in effect to no fade at all?
Just replace in the source code the “.fadeIn()” with “.show()”, everywhere.
Hi, I have 2 menus on the same page, when I expand the top one, it will overlap the second one, the second one will show on top of sub_menu expanded from the first menu… I tried with css z-index, but it didn’t work.
Try to change the z-index to the menu container in my example div #nicemenu. The first one should have for ex. z-index:101 and the second one z-index:100.
Hi, I would like to know why :
$(”#nicemenu span.head_menu”).mouseover(function(){
$(this).addClass(’over’)
})
.mouseout(function(){
$(this).removeClass(’over’);
});
does the same as
$(”#nicemenu span.head_menu”).mouseover(function(){
$(this).addClass(’over’)
});
$(”#nicemenu span.head_menu”).mouseout(function(){
$(this).removeClass(’over’);
});
there something here with javascript syntaxe ???
I prefer writing explicite statement, but your version seam’s to exploit a not decommented behaviour or I’ve got something to learn her ???
tx
form St-Hippolyte / Québec
Yes, it does the same.
Basic I just get the object $(”#nicemenu span.head_menu”) once, and applied the behaviors. What you suggest is to select the object twice and apply the behavior. If you do my way you save some power.