JSCookMenu: JavaScript Menu

 

stats counter

Introduction

JSCookMenu (v2.0.4) is a powerful menu script written in JavaScript that can mimic complex menus found in popular GUI Applications. It is relatively simple and easy to use. Creating a new theme requires some patience, but rarely does one has to write one since some good ones are provided.

This website is permanent (as long as I live and pay the bill :-).

Features

  • Supports both horizontal and vertical menus.
  • Supports relative positioning.
  • Supports different menus w/ different themes in the same web page.
  • Eases the menu creation process w/ a menu builder.
  • Special effects such as sliding and fading in/out is available.
  • APIs for JavaScript developers.

All that, for free :D But please remember to keep that copyright and the license information in the script since I did spend a lot of time writing it.

It would be greatly appreciated if you can contribute to this project by making donation$, reporting browser compatibilities, reporting bugs / fixing bugs.

If you need help, please do not email me directly. Post in the forum instead.

Notes

There are many projects out there using JSCookMenu, and I am NOT involved in any of them in anyways. Do not bother to send me emails asking questions on these projects.

If you modify the script for a project for any reasons, please put a "MODIFIED" notification in the file header. I received a number of complaints regarding hard coded limitations, apparently they were all using modified versions. When in doubt, you can always download the latest version from this site.

IE 7 beta 3 had a serious CSS bug, which has been fixed in the final release of IE7.

What's New

  • 2.0.4
    1. Fixed the bug that cmEnableItem setting the wrong isDisabled value.
    2. Fixed a missing semicolon issue that prevented the script from being compressed.
  • 2.0.3
    1. Fix an issue with IE6 displaying menu over HTTPS connection. Thanks to Paul Horton for reporting the bug and testing possible solutions.
  • 2.0.2
    1. Minor clean up and some attempts to reduce memory leak in IE.
  • 2.0.1
    1. Disable iframe masking for IE7 since it is no longer necessary.
  • 2.0
    1. improves the way handling flash/iframe/select boxes in IE and firefox and Opera 9. Hiding these elements is no longer necessary. For older versions of Opera, flash/iframe still need to be hidden.
    2. Improves cmDrawFromText (). Also allows custom actions.
    3. Improves clickOpen behavior. Now once a submenu is opened, opening other sub menus no longer requires clicking.
    4. Special Effects. This version has hooks that allow people to install special effects to various themes.
    5. For a given menu item, cmGetMenuitem(item) provides the ability to find the corresponding DOM element.
    6. Disable API. If you know which item to disable, you can call cmDisableItem(item, themePrefix) and cmEnableItem(item, themePrefix). However, you will have to provide your own CSS for the item. For purposes other than to disable an item, cmGetMenuItem (item) is provided for locating HTML DOM element of the menu item in concern.
    7. Better z-index. Now you can specify in the theme property the starting z-index and incremental step for submenus.
    8. Allow themes to insert additional elements before and after the sub menu table.
    9. Improved themes. More organized and easier to customize.
    10. Add a flag to control hiding/nohiding objects/iframes. By default, only Opera before 9 hides objects.
    11. Add new property options to control submenu positions to fine tune the look.
    12. It is no longer necessary to specify the theme name while calling cmDraw and cmDrawFromText. Currently it still accepts it, but it will not in the future.
  • 1.4.4
    1. a quick fix for a bug for _cmSplit checking. reported by Son Nguyen.
  • 1.4.3
    1. changed how _cmSplit is handled a bit so that _cmNoClick can work properly. All splits in predefined themes are changed to use _cmNoClick instead of _cmNoAction.
  • 1.4.2
    1. fixed _cmNoClick mouse hoover bug.
    2. fixed a statusbar text problem that cause text to disappear when hoovering mouse within the same menu item.
    3. changed the behavior of cmDrawFromText s.t. if the title of the of a link is empty, the actual url is used as text. To clear this link information, title needs to be ' '.
  • 1.4.1
    1. fixed a problem introduced in 1.4 where re-entering a main menu item which doesn't have a child can disable its hover setting. Apparently I deleted an extra line of code when I was doing cleaning up. Reported by David Maliachi and a few others.
  • 1.4
    1. fixed a minor td cell closure problem. Thanks to Georg Lorenz <georg@lonux.de> for discovering that.
    2. added clickOpen to nodeProperties. See _cmNodeProperties for description. Basically menus can be opened on click only.
    3. added an ability to draw menu from an html node instead of a javascript tree, making this script search bot friendly (I hope?).
  • 1.31
    1. fix a bug on IE with causes submenus to display at the top left corner due to doctype. The fix was provided by Burton Strauss <Burton@ntopsupport.com>.
  • 1.3
    1. automatically realign (left and right) the submenu when client space is not enough.
    2. add _cmNoClick to get rid of menu closing behavior on the particular menu item, to make it possible for things such as search box to be inside the menu.
  • 1.25
    1. fix Safari positioning issue. The problem is that all TR elements are located at the top left corner. Thus, need to obtain the "virtual" position of these element could be at.
  • 1.24
    1. fix window based control hiding bug thanks to Felix Zaslavskiy <felix@bebinary.com> for the fix.
  • 1.23
    1. correct a position bug when the container is positioned. thanks to Andre <anders@netspace.net.au> for narrowing down the problem.
  • 1.22
    1. change Array.push (obj) call to Array[length] = obj. Suggestion from Dick van der Kaaden <dick@netrex.nl> to make the script compatible with IE 5.0. A number of other people have also suggested this change.
    2. changed theme files a little to add z-index: 100 for sub menus. This change is necessary for Netscape to avoid a display problem.
    3. some changes to the DOM structure to make this menu working on Netscape 6.0 (tested). The main reason is that NS6 does not do absolute positioning with tables. Therefore an extra div layer must be put around the table.
  • 1.21
    1. fixed a bug that didn't add 'px' as part of coordinates. JSCookMenu should be XHTML validator friendly now.
    2. removed unnecessary display attribute and corresponding theme entry to fix a problem that Netscape sometimes render Office theme incorrectly
  • 1.2
    1. fixed the problem of showing status in Netscape
    2. changed the handler parameters a bit to allow string literals to be passed to javascript based links
    3. having null in target field would cause the link to be opened in the current window, but this behavior could change in the future releases
    also, added Menu Builder to ease the menu building process.
  • 1.11
    fixed the problem of not showing status in Netscape.
  • 1.1
    In IE, hide controls such as <select> when they overlap w/ the sub menu. The reason is that IE use window based controls and thus z-index cannot affect them.
  • 1.01
    generated XHTML code to produce better behaved menus. Animation possible.
  • 1.0
    the first public release.

 

heng' html

 

 

 

Support This Project

 

SourceForge.net Logo

(c) Copyright 2002-2007 Heng Yuan. All rights reserved.

Valid XHTML 1.0! Valid CSS!