The sordid tale of mm_menu/fw_menu.js

Andy on Aug 11th 2006

Recently I came to the conclusion that I should write about JavaScript menus. Why? Well, the other day I was searching for my name in Google and noticed that the top hits, and most of the hits, were related to mm_menu.js and fw_menu.js. Now I know its bad form to Google for your own name, but trust me, I was provoked. I noticed in my local blog searches people were searching for menu and mm_menu, despite the fact that I have never written about them on this blog. So why were people looking for them here? It turns out the very top of the mm_menu.js file has this:

/**
* mm_menu 20MAR2002 Version 6.0
* Andy Finnell, March 2002
* Copyright © 2000-2002 Macromedia, Inc.

Ah, in those days I was young and foolish. Foolish enough to leave an electronic paper trail back to me. You don’t see me making that mistake again.

I ended up looking at a lot of the sites that referenced mm_menu or fw_menu. They are typically web developer forums. Most the conversations on said forums go like this:

Newbie: I’ve got these mm_menu.js menus, and I want to them to scroll/delay showing/be horizontal/play the harmonica.

Expert (usually Murray): Those menus suck, don’t use them.

Newbie: But I have most of it working already. I don’t want to start over again.

Expert/Murray: Curse you Marcodobia!

The conversation usually goes downhill from there. There’s also the misunderstanding that I own those menus or even created them. One poster suggested that they take up a collection and pay me to add more features. Ha ha! Dude, I like the idea of you giving me money, but not the idea of me coming within ten miles of the menu code.

How did I get involved with this if I’m not the creator of this mess, you ask? *sigh* Well, if you insist on asking me that question, I guess I have answer it.

I was tricked into it, like most things. I had just started on the Fireworks team at Macromedia when they were trying to push out Fireworks 4.0.2, a bugfix release. The JavaScript menu feature had been released in the 4.0 release, and they had a serious bug already. This would have been a warning sign to anyone with experience, but not me. My boss innocently said, “Say Andy, we’ve got this one simple bug in the menus code. Could you take a look at it?” Not realizing that was manager code for “Run! Run like the wind!” I said “Sure” and went to work. It was a bug in Internet Explorer. A bug that started my hate-affair with IE. I managed to get a work around in that didn’t bloat the code too much more than the already 20k it was at. I thought that was the last I’d have to deal with that code. But no. Through the scientific process of “you touched it last, you own it” I now had to maintain it for the rest of my career at Macromedia.

You see, I didn’t even create this mess. It all started with some dude over at Netscape named “Gary.” (Most likely a pseudonym. He probably had enough sense not to leave his real name on anything.) He wrote this JavaScript library that allowed menus to be created on the fly in Netscape 4. Yep. Netscape 4. As the legend goes, towards the end of the Fireworks 4 development cycle, someone decided JavaScript menus would be a great feature for Fireworks, a graphics program, to have. The engineer tasked with this feature didn’t have time to write such a thing himself, so he searched for something to start from. As fate would have it, he found “Gary”’s JavaScript menus. Noticing that the JavaScript file wasn’t near bloated enough, the engineer added support for Internet Explorer and the then alleged Netscape 6. He managed to get it up to 25 kilobytes. Take that you 14.4kbps modem users.

For reasons now obvious, that engineer quickly fled the company and the state soon after the Fireworks 4 release.

Which left naive little me to deal with them. The next version of Fireworks, MX (Yeah, I know that’s not a version number, but tell it to the marketing guys. They have trouble with numbers vs letters.), was supposed to have many improvements to our hit feature, the JavaScript menus. By “hit feature”, I mean everyone loved them until they figured out how badly they sucked. Fortunately for us, you can’t try out a feature when the CD is still in the box.

Learning how the menus even worked was a huge pain the backside. It was a lot of non-obvious, uncommented code. But I figured it out and added all the features management claimed we needed, and managed to bloat the code by 5k. It was also during this time I realized what a mess it was, and how badly we needed to scrap it and start all over again. I also helped tech support and customers out by telling them how to hack the code to add features we weren’t going to add directly. This was a mistake because, once again, I used my real name.

When we released MX, the customers marveled at how much code I managed to add without really improving anything. The experts complained because the menus were still huge, slow, inaccessible, un-crawlable, and didn’t work if the user had JavaScript turned off. The newbies complained because although all the new features were nice, they just needed one more feature before they were happy.

Al Sparber just laughed his way to the bank. (He sells competing HTML menus.)

For the next release there were murmuring of adding even more features. That’s when I pulled the engineer trump card and told them that new features couldn’t be implemented unless the menus were rewritten. That thoroughly killed menu work for the MX 2004 release. I began internally campaigning to have a new set of HTML/CSS menus created (there were lots of examples of these popping up externally).

There was a lot of internal movement between the MX 2004 and 8 release of Fireworks. I used that time to write a new version of the menus using HTML and CSS with a little bit of JavaScript. I cleverly substituted bloated JavaScript for bloated CSS. heh heh. That’ll show those experts. This was about the time I got moved off to Dreamweaver, and my good friend Mike ended up finishing up the feature (after it was killed, then brought back, then killed again, went on tour with the Stones, then finally revived.).

On the Dreamweaver side, we astutely decided not to support these new fangled menus, but still allowed the old kind to be created. This, of course, was heralded as a “Great Idea” by our advisors. No, just kidding, they hated it and called us names. Being the agile company that we were, we quickly had lots of emergency meetings and promptly decided not to do anything. That’s how Dreamweaver 8 shipped.

After Dreamweaver 8 shipped I left the company, and my involvement with those accursed menus ended.

Of course, none of this helps those of you suckered into using these menus. So for your benefit, I’ll now tell you how to fix the mm_menu.js. Follow these simple instructions:

  1. Acquire one (1) shotgun. Loaded, preferably.
  2. Acquire one (1) shovel.
  3. Pump mm_menu.js full of buckshot until you feel better.
  4. Repeat Step 3 as necessary or desired.
  5. With the shovel, dig a hole.
  6. Dump the remains of mm_menu.js into the hole.

If you’re confused on how to shoot an electronic file, I would suggest printing it out and shooting the printout. Sure, you could shoot the real thing off the hard drive, but you might have trouble determining if you hit the actual sectors the file resides on. Also, there might be economic and/or legal repercussions if you shot the hard drive.

So don’t use mm_menu or fw_menu. Go find one of the many HTML/CSS menus that are out there. Some are even free. You could even go buy one off Al Sparber. Tell him I sent you. For the number of people I’ve driven to his door by agreeing to maintain the JavaScript menus, he ought to give you some sort of discount.

Or perhaps he would just laugh maniacally at you and double the price.

Filed in Career, Programming | 25 responses so far

25 Responses to “The sordid tale of mm_menu/fw_menu.js”

  1. Charity Aug 14th 2006 at 01:32 pm 1

    You know, normally I dont read “technical articles” becuase I don’t understand them. But I read your’s all the way through, and found it enthralling. You seem like a very powerful person. I had no idea that menus were such an area of “power struggle” in the industry. I can imagine you and Elaine in the future having techy/geeky conversations over dinner.

  2. Michelle Aug 29th 2006 at 10:39 am 2

    Gosh thanks Andy! That was *helpful*!

    … oh, sorry; Macromedia’s built-in sarcasm function is busted too.

  3. sdozono Sep 4th 2006 at 08:22 pm 3

    hello. I confronted an issue of mm_menu.js + IE + iframe + select tag explained in the following URL.

    http://dev2dev.bea.com/pub/a/2005/04/portal_menus.html

    I applied the idea to mm_menu.js.
    http://douzo.seesaa.net/article/23271573.html
    This may be useful for someone…

  4. Zach Nov 2nd 2006 at 09:44 am 4

    After I started my current job I spent some time getting familiar with everything they had been doing pre-me — including heavy use of these incredibly sexy javascript menus.

    Knowing this story doesn’t help me wrangle them into doing what I want, since I have to use them to finish off the projects that were started with them. I am nevertheless glad I know who Andy Finell is, and that you shouldn’t be personally hated for the menus.

  5. DiLipkumar .B Nov 4th 2006 at 07:28 am 5

    Hello sir.. My name is dilip..

    My work is just put some information in a part of home page by clicking the javascript menu.. here i dont know how to do this.. plz help me.. take care.. bye..

  6. Al Sparber Nov 9th 2006 at 07:42 pm 6

    It was all good-natured fun :-)

    Wishing you well,
    Al Sparber

  7. Murray Nov 9th 2006 at 08:27 pm 7

    Curse you Marcodobia!

    Those f****ng menus are the bane of my existence. Thank you for the illuminating article on how this devil spawn was created, and why it should now go back into the depths. In FW8 (but amazingly NOT DW8) they rewrote them. The new ones can now write more than 2000 lines of CSS for a moderately complex menu with element ID tags that exceed 25 inscrutable characters in length.

    I want some of what they are smoking, really….

    Murray

  8. Donna Casey Nov 9th 2006 at 08:29 pm 8

    Oh, my sides hurt! (otflmao!) It’s great to know the backstory… thanks for the laugh. But as Murray would say, when it comes to FW menus, just say no!

    And a menu system from PVII is the best “less-than-$100″ bucks you’ll EVER spend!

    LOL :P

  9. Lori Nov 10th 2006 at 09:57 am 9

    You forgot the zillions of phone calls back and forth between California and Texas while we tried to figure out how to implement these stupid Pop-Up Menus as a Dreamweaver behavior back in, what was it, MX? Gah, doomed from the start.

  10. Cheryl D Wise Nov 11th 2006 at 12:31 pm 10

    Thank you,

    I enjoyed your semi-rant and know just what you are talking about.

  11. Judy Benedict Nov 11th 2006 at 05:04 pm 11

    Gosh Andy…I got sent here by Cheryl. I hate to tell you that shortly after I created my first javascript menu in FW, I started looking for ways to do the same thing with less code, tried suckerfish and then stumbled upon Project VII and I have never looked back! Don’t feel bad about complicating that FW menu mess, I am just happy you managed to escape and survive and are now a true Macromedia Graduate.

  12. lindsay Nov 12th 2006 at 05:33 am 12

    I think I love you. That was oh too entertaining to be a tech article.

  13. sdozono Dec 2nd 2006 at 02:07 am 13

    Hey!

    I finally fixed the memory leaking problem of mm_menu.js in the Internet Explorer!

    Change:

    Line 324:
    //l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
    l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = “menuItem” + menuCount;

    and,

    Line 650:
    //var itemLayer = theLayer.Menu.menuItemLayers[j];
    var itemLayer = FIND(theLayer.Menu.menuItemLayers[j]);

    Then, NO MORE memory leaking! I confirmed with the “Drip” memory leaking tool. Hurray!

  14. Silver Jan 26th 2007 at 01:35 pm 14

    I’ve a great way of solving memory leaks with mm_menu.js too:

    rm -f mm_menu.js

    (or, I guess del mm_menu.js if you use windoze)

    and use tips from here:

    http://css.maxdesign.com.au/listamatic/

    Its really not rocket science to write decent code.

  15. Jose Perez Feb 22nd 2007 at 08:48 pm 15

    Good article. Funny, light, great commentaries. Am currently using Dreamweaver and Fireworks MX and experiencing difficulties (understatement) with js menus…ready to scrap the whole thing. And now I will. Thanks.

  16. php_guy Mar 23rd 2007 at 03:31 pm 16

    Ya know … I’m guessin I’m relatively lonely on this, but I don’t find the menus all that bad.

    In fact, I just use the mm_menu.js file, mod it as needed for transparency and dynamic generation with PHP/MySQL, and away I go. No biggie, right?

    I must say, I did need a laugh today and this post delivered.

  17. Lanny Chambers Apr 3rd 2007 at 07:02 pm 17

    As a FW user since monkeyboy, I really enjoyed this tale–thanks, Andy. Thanks to Murray, too, for introducing me to Al’s elegant P7 solutions, thus saving my sanity.

  18. Cookie Pierce Apr 27th 2007 at 08:17 am 18

    I got sent to this URL by a potential client who looked at the source code for a couple of the sites I’ve developed! I must say I’ve been having trouble with the FW menus too — the implementation in Fireworks is so poor that the “Appearance” tabs don’t even function, so I had to create the menus and then try to figure out how to modify the appearance by changing the Javascript. Which of course made me wonder why I hadn’t just written the Javascript myself. (Answer: I thought Macromedia had taken care of it for me!) I will definitely try Al’s product on the next website I have to develop. Thanks everyone for the story and the great comments.

  19. Dreamweaver Menus…A Solution, and Then Some « Land of the Nancilla Jun 17th 2007 at 01:13 pm 19

    […] I began using Dreamweaver (first 8, and then CS3) to help me create a series of dropdown menus, with an applet directly underneath the navigation bar. Almost immediately, I ran into the problem of my dropdown menus appearing behind the applet instead of in front. I scoured the web for many days, searching for a solution, and mostly what I found were suggestions to rearrange the page so that the menus simply wouldn’t drop down in front of something (an answer I found to be particularly frustrating), unanswered pleas for help often accompanied by insane and intimidating code posts (Dreamweaver’s drop-down menus come with a nasty-looking javascript file), or criticisms of Dreamweaver’s drop-down menus (and rightly so), with suggestions to go find a free one or follow some tutorials. I also fell upon Andy Finnell’s criticism (http://www.losingfight.com/blog/2006/08/11/the-sordid-tale-of-mm_menufw_menujs/) of the menus, and you know it’s pretty bad when even the guy who had a part in developing part of the menus tells you not to use them. […]

  20. bt3of4 Aug 20th 2007 at 08:09 am 20

    Interesting hate_menu posts. I was getting along with them, until I decided to road-map my entire site through the menu items. Turns out when you lose your mind like this, so does the code. Starts displaying the sub-sub-sub menus completely off the monitor.

    Was just looking to see if anybody had fixed this yet when I ran into this. funny indeed. Problematic for me, but funny nonetheless.

  21. Viki Sep 4th 2007 at 04:54 am 21

    I know its a very good script, but after searching the net for almost 5 hours, I cant find any information about how to configure the script, I need to reduce the gap between two vertical menus.
    plz publish a mm_menu.js with comment so that people like us can modify it to match their need.

  22. artboy34 Nov 1st 2007 at 06:58 am 22

    Wow. I’m not going insane. What a relief! I have been losing the battle against drop-down menus here for some time, but now I have ammunition to use in the fight. You think you’ve mastered the code, and then the client opens your test site in an archaic browser set to a screen resolution that even the Blind Center finds unnecessarily large, and the two (yeah that’s right… TWO) items in the one drop-down appear at the top left hand corner of the screen. Yeah, it’s been one of those days. Thanks for the laugh, and timely info – I needed both!

  23. Zev Jan 2nd 2008 at 01:18 pm 23

    Came by this article the same way *everybody* else has. Thanks for giving me a wonderful opportunity to procrastinate from fixing my menus.

  24. Frosty Apr 7th 2008 at 12:15 pm 24

    You can’t polish a turd, but you can shape it into a chocolate bunny.

  25. Step By Step Web Design Course Using Dreamweaver & Fireworks. | 7Wins.eu Jun 13th 2008 at 05:52 pm 25

    […] on Adobe Labs at Creative ToolboxNotes on Design » Blog Archive » Quick Imaging in Dreamweaver CS3Safe from the Losing Fight » The sordid tale of mm_menu/fw_menu.js Tags web design macromedia dreamweaver adobe dreamweaver macromedia fireworks dreamweaver 8 […]

Trackback URI | Comments RSS

Leave a Reply

Bad Behavior has blocked 780 access attempts in the last 7 days.