17
May

Flyout Menu

This animated JavaScript flyout menu is clean and lightweight at only 1.6kb. The script is based on the post a few weeks ago of a horizontal dropdown menu. The markup is the same so visit the horizontal menu post for details.

This script has been tested in IE6/IE7, FF, Opera and Safari. Feel free to use it in any personal or commercial projects. Send any bug reports to michael@leigeber.com.

Click here for the demo.

Click here to download the source.



6 Diggs Spread This

106 Responses


[...] Click here for a vertical flyout version of this menu. [...]

Sliding JavaScript Dropdown Menu - Web Development Blog on 17 May 2008 at 12:07 am

[...] скрипт выпадающего меню. Все это читайте на первоисточнике. Если же читать не желаете, то: демо можно просмотреть [...]

Блокнот » Blog Archive » Выпадающее меню на JavaScript on 17 May 2008 at 4:26 pm

Mr. Leigeber,
You are so in control you are out of control!

Great job. Very nice. I appreciate its low foot print. As soon as I get this up I will be happy to let see your work in action…. domo. p

Peter A on 18 May 2008 at 6:42 pm

[...] блог Майкла Лейгебера. Категория: JavaScriptАвтор: Spider Дата: 19 Май 2008 Время: 22:18 [...]

Вертикальные выпадающие меню на Javascript | АяксЛайн.ру on 19 May 2008 at 4:19 pm

@TaTaC – For now yes. It could fairly easily be extended to handle multiple levels. I plan on having both the horizontal and vertical versions with multi-level support within the next week.

Michael on 21 May 2008 at 7:58 am

color is so light.maybe can little deep.

Booto on 21 May 2008 at 10:15 am

@Booto – You are free to alter the CSS in any way to accommodate your GUI.

Michael on 21 May 2008 at 10:32 am

Any chance for a wordpress plugin for this? Very Nice!

Bill Mead on 28 May 2008 at 12:24 pm

Michael – quick question – how does the opacity work on this?
What if I don’t want the background color to reach “opacity: 1;” -
I tried setting it in the css but I think it has something to do with the “flyout.js”.

Anyways – great job and thanks… – so glad I found your blog :-)

daveyp on 29 May 2008 at 12:31 pm

@Bill – It is possible, I will take a look at it.

@daveyp – On line 54 you will see that the opacity is simple a fraction based on the height. You could just divide the result by some number or change that code around to function as you please. Shoot me an email if you need any help. michael@leigeber.com

Michael on 29 May 2008 at 12:40 pm

prob overlooking something really simple…but how would i make menu item #3 a link?

thanks!

jenn on 30 May 2008 at 3:46 pm

@jenn – You might want to take a look at the original dropdown menu. It has the information about creating a new menu, the same markup applied the the flyout. If you are still having trouble shoot me an email at michael@leigeber.com.

Michael on 30 May 2008 at 3:48 pm

[...] Vertical Flyout JavaScript Menu por Leigeber [...]

Freak-Log™ #12 — Freak Group on 30 May 2008 at 9:34 pm

[...] Vertical Flyout JavaScript Menu [...]

This Month’s Best: May 2008 - Six Revisions on 31 May 2008 at 12:16 pm

[...] Menú deslizante con efecto de aparición. [...]

JavaScript sin frameworks / acualicio.us on 01 Jun 2008 at 9:39 pm

I’m on FF3 RC1. I cant’ see any effect of the script :(

ArbuZz on 02 Jun 2008 at 1:33 am

Is there a vertical and horizontal menu combination? I need to implement a horizontal menu with the option of submenus to open vertically. Anyone come across that or know if it can be done with this menu?dropdown.js

Ray on 08 Jun 2008 at 8:25 pm

@Ray – There is a horizontal menu a few posts back. Let me know if that isn’t what you are looking for. michael@leigeber.com

Michael on 08 Jun 2008 at 8:29 pm

Is there a vertical and horizontal menu combination? i try to combine them but unsuccessful.

mikiko on 08 Jun 2008 at 9:57 pm

Noticed this comment:

@TaTaC – For now yes. It could fairly easily be extended to handle multiple levels. I plan on having both the horizontal and vertical versions with multi-level support within the next week.

Any chance that it’s done yet?

John on 09 Jun 2008 at 11:15 am

@John – I am about done, hung up on an IE issue as usual. Will post as soon as it is available.

Michael on 09 Jun 2008 at 11:16 am

@Michael – I want to have your babies! I cant tell you how much time you’ve saved me in this complete overhaul I’m working on. Looking forward to the release of the multi-level script. Your skill in lightweight java is priceless and the fact that you don’t horde it reminds me of the early days when the net was built by a share and share-alike community of dev’s.

Sean on 20 Jun 2008 at 10:50 am

[...] al menú, está hecho en JavaScript y es la hostia de simple. El copyright de todos modos es de Leigeber (si alguno lo quiere implementar en su web tiene que bajarse el pack en la web del autor y debe de [...]

» Blog Archive » Things on 24 Jun 2008 at 11:36 am

Noticed that the background doesn’t change in the boxes in IE 6 if it’s an image. Works on other browsers. Is there a workaround?

Justin on 25 Jun 2008 at 10:07 am

Have you done a 3rd level of flyout? I am trying to get that, but am having some problems. Also, I am wondering about linking the main “button.”

Thank you for the menu!

Brenda on 26 Jun 2008 at 11:30 am

@Justin – IE6 does not support the :hover property. You would code a “work around” with JavaScript but personally I am fine with the few IE6 users not getting the effect.

@Brenda – I almost have completed the code but have been far too busy to work out the couple remaining bugs. Soon hopefully.

Michael on 26 Jun 2008 at 8:17 pm

Dear author,
Is it possible to create sub menu of sub menu.
For example:
1. Customer
1.1. New Customer
1.2. Edit Customer
1.3. Serach Customer
1.3.1. By Company
1.3.2. By By City

Awaiting of your quick reply.

Shan Khan on 03 Jul 2008 at 2:26 am

What about multilevel menu???
Is it ready???
Pls reply us soon.

Shan Khan on 03 Jul 2008 at 2:29 am

@Shan Khan – I have had no time recently having taken a new job and moved cross country. Things will finally settle down next week so hopefully then I can catch up this script as well as a couple others.

Michael on 04 Jul 2008 at 8:20 am

hello! Nice work :) Can it be used normal frames (instead of inline frames)?

Erick on 18 Jul 2008 at 1:06 pm

IN above “@jenn – You might want to take a look at the original dropdown menu. ” (May 30 reply) … where do I find original dropdown menu so I can make menu item 3 a link without screwing up alignment.
(The updated website not online yet…due to problem with alignment of adding the a to menu items like 3….)…

Katie Allen on 20 Jul 2008 at 4:15 pm

Hey guys. Micheal, I know you’re busy so i don’t expect that you have it completed yet, but has anyone come up with a solution to multi-levels?

Jesse on 21 Jul 2008 at 9:14 am

Amazingly perfect.. and sooo easy to customize. Don’t change a thing!! Great job!

Jeff on 21 Jul 2008 at 10:16 am

Hey Michael

Very nice work, and like Sean said, you’ve just saved me a lot of time. Love it – hugely appreciated.

little zed on 22 Jul 2008 at 5:11 pm

Is there a way to make the top level a clickable item? I have one item on my menu that doesn’t need any submenus, but can’t seem to figure out how to get the top level to act as a link.

Ben on 30 Jul 2008 at 11:17 am

Has anyone succeeded in linking just the menu item, in addition to the fly-out menu?

Brenda on 30 Jul 2008 at 1:57 pm

OK. This may be “old school,” but it works. I made a style for an anchor tag, with the background set to a transparent .gif file, and then linked the menu item. The definition list still produces the fly-out, but now I also have a “button” with a link for the main menu selection.

Brenda on 30 Jul 2008 at 3:55 pm

@Erick – This script is really not intended for iframes.

@Katie Allen – The vertical dropdown is what I was referring to.

@Ben and Brenda – I updated the demo so that the fourth dropdown header is a link. Take a look at http://sandbox.leigeber.com/flyout/flyout.html.

Michael on 03 Aug 2008 at 9:34 am

Can you please let me know if it is possible to have a multicolumn version of the vertical dropdown?

Sukh on 05 Aug 2008 at 1:32 pm

@ML

Thanks for that. For some reason, when I make it a link, it extends the color of the menu to the right past the boundaries of the box.

Ben on 06 Aug 2008 at 11:20 am

Yes, i am presented with the same problem. I also get the grey menu link that extends outward. I redownloaded the demo, but it has not been updated i nthe zip file. I assume you edited the css file as well? I am kinda stuck at the moment.

Gunnar on 07 Aug 2008 at 8:01 am

ok so i managed to get it working, kinda. I edited the css file, the grey block is now not extending outward anymore, however i still have a visible grey area on top of the button. When i remove the background it is very visible.

@Ben: edit the following line in css (.dropdown a). Change padding to 0px. This should remove the outward clickable area. the rest i am still trying to figure out.

Gunnar on 07 Aug 2008 at 8:26 am

ok, so changing the padding to 0px changes the flyout menu items as well, so rather don’t change it. Back to square one.

Gunnar on 07 Aug 2008 at 8:56 am

Hi Michael,

I used your vertical drop down box for the intranet site of my company (using IE7). With some moderations, it worked out really nice!
The only thing i cannot fix is that I want the original background back. You told someone to fix it in JS in line 54. But i am really a noob with JS. Can you send me the moderated section (code) for no opacity?
And the second problem: the image for the menu works, but not the hover image. Maybe because hover can only be used with “a”? You know how to fix it?

Carlijn on 08 Aug 2008 at 7:19 am

@Sukh – Sure, just float:left some divs/lis/etc.

@Ben – Probably an issue with the widths being set in the CSS. Play around with it and you should be able to resolve.

@Gunnar – Shoot me a link and I will take a look. It can be a little tricky.

@Carljin – IE6 only supports the hover on a link buT the other browsers should have no problems. I am not 100% sure what you are referring to with the opacity. Email me and I will get back to you when I can.

Michael on 12 Aug 2008 at 8:20 pm

Hi great menu Michael,

I’ve created a multicolumn version (4 of the menus side by side on one page). It works perfectly in firefox (v2), however in IE7 the pop up layers keep appearing underneath the next column. I can’t find out whats causing it (Zindex possibly?).

Anyone come across a solution to this problem?

Peter on 19 Aug 2008 at 8:47 am

Actually just cracked it. I needed to have each preceding menu with a higher z-index in the container divs. So the left most menu’s zindex needs to be 4, the next 3 and so on. Don’t mind me – today has been a bit of a learning curve.

Thanks Again!

Peter on 19 Aug 2008 at 8:57 am

Hello.

Awesome menu.
I am new to JS, but… is there a way to make the menu slide from the left.
So when I roll over a link, the sub-menu slides in from the left.
Also, how can I take away the offset from the top. So that I can offset the menu anywhere in the page I want. Any input would be nice, thanks.

P.S. Here is a site, http://www.rhinoliningsindustrial.com/, the menu is in flash, but you can get an idea of what I am talking about. That is what I want to re-create in JS and I can see this script bring capable, thanks.

Lamont on 26 Aug 2008 at 11:29 am

@ML – thanks very much for this, you’ve helped me out no end!!! I’m still learning this whole html/css malarky so still having a few teething problems.
Whats the div id “wrapper”? is it essential for this to work?
I’m using this in a shared php so only the right hand column will show this on every page. I need it to be 140px wide so the main body text for all the other pages will align at the top. At the moment the main body starts underneath where the drop down menus finish, so i’m wondering if the “wrapper” is in the way.
I hope i’m making sense explaining this!!! Can you help?
Many thanks, Sami

Sami on 27 Aug 2008 at 4:24 am

@ ML Never mind, i just changed it about a bit and got what i need! Thanks anyway!!

Sami

Sami on 27 Aug 2008 at 4:45 am

@ML
OK i’m stuck again!!
I have 4 menu buttons listed with horizontal pop up menus. Ive managed to change the layout to what i want but i want one of them to be a different colour to the others and the pop up to different colour aswell. I’ve tried making a new setting but either nothing changes or the the colour does change but the pop up menu appears underneath instead of to the right.
How can i change this?

Thank, Sami

Sami on 27 Aug 2008 at 5:28 am

Great menu – it’s wonderful.

Smart Boy on 27 Aug 2008 at 9:23 am

[...] Vertical Flyout JavaScript Menu [...]

This Month’s Best: May 2008 « Jonsunhee’s Weblog on 29 Aug 2008 at 2:00 am

I have used your code…THANKS!…but I have had to modify it a little bit and it doesn’t exactly look like the pretty buttons you have on your page, but I was more interested in the cool fade in type drop down effect than the buttons, what I have will work for me. I do not have this page up as of yet for you to see, but do have a question. Frequently I must change the information in the drop down box to link to different places, the site I am wanting to use it on has at least 15 pages which means the way that this is set up, I have to edit 15 pages every time something changes. Is there a way to make an external sheet to link to for the link information? If so could you show me how? THANK YOU

Mel on 01 Sep 2008 at 4:35 am

I am new to CSS and javascript…How do I link to a website if it doesn’t have a flyout. In this example, how would you link “menu item three” to another website?

Thanks for your help!!!!

Jennifer on 01 Sep 2008 at 1:18 pm

Hi! This is a great flyout menu! I’m wondering if you’d got any further with the wordpress plugin idea (original query by Bill). I’d love to use it in a site for my father-in-law.
Thanks!

Chuck on 01 Sep 2008 at 7:04 pm

can this menu be expandable dropdown menu please help

Padma on 03 Sep 2008 at 12:11 pm

great script… would it be difficult to modify so the flyout menus appear on the left side? i’d love to work this into a hebrew site i’m building…

cheers

dog on 04 Sep 2008 at 9:13 am

You can also do like this if you want the first menu button to be linked:
EXAMPLE:

<dl class=”dropdown”>
<dt id=”five-ddheader” class=”upperdd” onclick=”javascript:document.location.href=’http://www.google.com’”>GOOGLE</dt>
</dl>

d0ri0 on 07 Sep 2008 at 1:54 pm

Great.. i tried something similar with CSS2 but it was not not this smooth effect.. this one is awesome !!!.. thanks :-)

deen d on 08 Sep 2008 at 3:40 am

[...] 7. Vertical Flyout JavaScript Menu; [...]

300+ Jquery, CSS, MooTools and JS navigation menus | 1stwebdesigner on 12 Sep 2008 at 4:56 pm

Hey!, really nice script. Thanks for giving if for free. Greetings from Mexico. :)

Rodrigo Spesia on 13 Sep 2008 at 3:51 pm

[...] 7. Vertical Flyout JavaScript Menu; [...]

300+ Jquery, CSS, MooTools and JS navigation menus | PaulSpoerry.com on 14 Sep 2008 at 10:06 am

excellent work, thank’s for you contribution. :)

Alojaweb on 16 Sep 2008 at 10:52 pm

high level, thanks

Jersey on 16 Sep 2008 at 10:54 pm

[...] Vertical Flyout JavaScript Menu [...]

Navigation Effects Using JavaScript - Hidden Pixels on 22 Sep 2008 at 4:37 am

M, did you finish the multi-level code and if you did where can we download it? BTW, great job, I have a great deal of respect for “old-school” programing when a programmer starts from scratch (no jquery, prototype etc) and produces a light and fast code!

Peca on 23 Sep 2008 at 6:03 am

Hello all. Thanx for the great menu!
Does anyone know how to put a link to the menu item three (the one with no sub category)?
Thanx again!

nuntius on 24 Sep 2008 at 1:55 am

I have a question on this menu system. I’ve implemented it into a website, and one of the menus that I have has multiple links, and in some cases, it’s longer than the web page that is displayed. The menus don’t scroll down, so if the page is too short, you can’t get to the end of the menu. Can you help me with this?

Thanks.

Brenda on 24 Sep 2008 at 2:10 pm

OK, I know this is kind of novice, but how do I create a clean looking link from the main menu without a flyout?

Thanks much!

jeff on 05 Oct 2008 at 2:02 pm

Realy cool! thanks a lot!

Айрат on 24 Oct 2008 at 6:40 pm

This is awesome, anyway I can change all the parent sides be links in addition to the flyouts? If not, at least change “Menu Item 3″ to be a link would be fantastic.

Dan on 30 Oct 2008 at 6:52 pm

Michael, Thanks for the script – it looks just the thing. However, I need for the sub menus to fly out to the left, not the right. I’ve been experimenting but no luck so far. Can you give guidance? Many thanks.

Neil on 01 Nov 2008 at 2:54 pm

Super, great stuff. Thanks

Vitalia on 08 Nov 2008 at 11:05 am

Does it support multilevel ? I tried without success..Let me know. Otherwise it is awesome :)

Samir on 13 Nov 2008 at 5:09 am

[...] 7. Vertical Flyout JavaScript Menu; [...]

300+ Jquery, CSS, MooTools and JS navigation menus | Neurosoftware web dev on 17 Nov 2008 at 5:49 am

Thank you so much for this – it rocks!

For my own use, I modified it so that it only does not do the slide effect, just the fade: http://www.gingerbeardman.com/flyout-fade.zip

matt on 18 Nov 2008 at 10:31 am

Thanks so much! This an awesome piece of work; too good to be free!

Thanks again, from South Africa.

SmL9 on 21 Nov 2008 at 9:50 am

I scanned the comments and as far as I know i didn’t see anybody with this issue. I have the menu working perfectly in all browsers except IE 7. When i mouse-over on the expanded menu, the menu disapears once i go between each item.. as soon as the “finger” goes away, it disapears.. Any thoughts? thanks..

Kurt D on 09 Dec 2008 at 12:08 pm

Re: Vertical Flyout JavaScript Menu
Per the example how would you make dropdown four link to another website?
When adding the “href” my style comes out as the flyouts not as the main menu.

dwayne e on 22 Jan 2009 at 12:32 pm

I’ve been trying to put this into a table on dreamweaver and for some reason it just will not work, I tried both versions of this drop-menu and neighter has worked. I need help…

Hitoshi on 26 Jan 2009 at 6:54 am

Hi, very nice Menu and a big thx for the free use!!!
I wished a second level, but its not soo important.
Thank u very much.

ratsplayer

ratsplayer on 28 Jan 2009 at 5:52 pm

hmmm…works great in development and in preview. But expanded menu does not expand when live in IE and Firefox. Any thoughts?

Rusty on 04 Feb 2009 at 2:47 pm

Sorry…should have added IE 7 and Firefox 3.0.5. Any assistance would be much appreciated. Thanks for what you do.

Rusty on 05 Feb 2009 at 10:05 am

hi,
I now use the menu in my webpage and I very much like it so thanks for that, but there’s one thing: if I maximize my browser (1680*1050), the sliding effect is slower then when i use a small screen. Does anyone else have this problem and/or knows how to fix this?

taddeus on 18 Feb 2009 at 6:36 am

hi again, in addition to my last post:
in IE the fade effect does’t occur at the first mouseover over a menu link, Then the submenu is just there. At the second mouseover the fade effect does occur. This happens everytime after i refresh the page. Could anyone help me out?

taddeus on 18 Feb 2009 at 7:05 am

Hi,
How do make the sub-menu fly to the left? I tried but could not make it work.

Thanks

B. Tran on 19 Feb 2009 at 12:17 pm

Hi,

Awesome script, exactly what i’ve been looking for. I’m looking to use the slideup version of this menu, but am struggling to see the difference in code between it and the dropdown version. Is anyone able to tell me where i should be looking and what code i should be changing? It’d be a massive help!

Thanks,
Neil.

Neil on 25 Feb 2009 at 11:35 am

Hey i am using this script to..

but i need a 3 sub menu. Is this possible with this script?

Ty send me a mail at rovtar(AT)gmail.com

Luka on 04 Mar 2009 at 9:26 am

This is an awesome menu; however, I am new to HTML and CSS. How do I put these files into Front Page??? I downloaded the files already and opened each one up in FP separately. How do I get this to work? Do I copy and paste all of this into one file? Please help. Thanks, TW

Tony on 08 Mar 2009 at 1:16 pm

Nice script, would be cool to have as a wordpress plugin :)

Kino on 11 Mar 2009 at 3:28 am

Im not very good with javascript, if I wanted each button to have its own image, and own roll over image, is there a way to do that?

KawaiiAyu on 20 Mar 2009 at 9:58 am

This is a great, clean script. My current menu setup screws up with Firefox and Chrome. But is there a way of getting this so that the actual menus are embed in the script? That way, when a change is made to the menu, it would be represented on all pages. (I had also left this message on the “drop-down” version, but meant to leave it here. The joy of trying to cram real-life stuff in while at work.)

Craig on 23 Mar 2009 at 9:20 am

Im facing the problem wat Peter faced. Menu works perfectly in firefox, however in IE7 the pop up layers keep appearing underneath the next column. I can’t find out whats causing it (Zindex possibly?).
And in the next comment he wrote that he has fixed the prob by changing the Zindex. And it doesnt work for me. Any help for the needy!!!!!!

Don on 29 Mar 2009 at 11:53 am

Can anyone help in creating a WordPress plugin from this ?? It is a much needed functionlity and i want to add this to my left navigation widget. Any workaround to accommodate this will be appreciated.

Thanks.

Purethoughts on 09 Apr 2009 at 12:26 pm

did you ever manage to adapt this script so that it allowed a second level of flyout? Would really like to use this on a site, but need more than one level

Jason on 22 Apr 2009 at 6:45 am

Hi,
Great Job! Just what I am looking for… I have one problem… A flash object slide show. The flyout is going behind the object. How do I get the flyout on top? Is it possible?
Boy I hope so… because this one nice little menu!
Judson

Judson Mitsock on 24 Apr 2009 at 9:22 pm

[...] Click here for a vertical flyout version of this menu. [...]

Web Development Bangladesh on 28 Apr 2009 at 4:42 pm

Heiii man… ur really gr8. but i would like 2 ask u 1 think, how i can make one more drop menu for the each sub menu???

shyju on 15 May 2009 at 10:58 pm

[...] 7. Vertical Flyout JavaScript Menu; [...]

300+ Jquery, CSS, MooTools and JS navigation menus « Dogfeeds——IT Telescope on 27 May 2009 at 3:13 am

I’ve been able to get first level of the menu to use a gif file as the background, how do I get the second level to do the same? BTW, great menu!

mhug on 28 May 2009 at 4:28 am

Hi there, great menu, very easy to use… except for one problem!….. It seems so easy but it wont go for some reason…. how can i change the width of the submenus? they dont seem to change no matter what i change on the css.

Thanks, great work

JohnM on 10 Jun 2009 at 4:47 am

This is a really nice menu, well done.

How would you go about adding a 3rd level?

Ryan on 16 Jun 2009 at 9:22 am

Hi there!
Firstly, Thank you Michael, I love all of your scripts, so light, so clean, you are a generous genius.
Second:
Here is a quick little work around I figured out for multiple sub levels on the flyout menu, I have noticed many people asking for this function, me being one of them.
Ok, here we go:
First, use Michael's drop down menu instead of the flyout menu, it is a little bit leaner/ easier to modify and I prefer it.
After you have downloaded the dropdown menu files, open up the style.css and make these changes.
1. On "ul.menu" simply add a width property, anything but 100% seems to work, I went with 100px, this forces the menu to line up vertically instead of horizontally.
2. On "ul.menu ul" change the "top:26px;" to 5px or 0px, this brings it up, also add "left:149px;", this pushes the original dropdown over to the side of the menu.
That's it! Now you have a flyout menu with as many sub levels as you desire. I've tested this in Mozilla as well as IE 6 and 7, seems to work just fine.
I know this is quite a rudimentary fix, but hey, it's simple and it works.
I hope this helps some of you out.
Keep up the good work Michael.

Roscoe on 19 Jun 2009 at 1:17 pm

I love this, I just need it in different colors. I guess it is possible to change the colors?

Allie on 26 Jun 2009 at 8:48 am
Trackback URI | Comments RSS

Leave a Reply

RSS Feed | Email
Powered by FeedBurner
Recent Links