1) CODE TITLE: Omni Slide Menu script
2) AUTHOR NAME/NOTES: jscheuer1 - Years ago when I first became interested in DD, one of the first menus I tried was 'David's Menu'. There was just something about it that I liked. It is now Dynamic-FX Slide-In Menu (v 6.5). Over the years, from time to time, I have been asked and/or have just tried to get this menu to slide in from the right. The code is very old (at least parts of it) and more confused looking than I am used to seeing when working on a DD authored script (this one is a third party - Maximus authored script). So I decided to start from scratch. This current menu is the product of that effort and surprisingly uses many of the same general methods of the original, even though I created almost all of the code from scratch.
3) DESCRIPTION: Omni slide can look and act just like its predecessor except that it requires a modern browser (document.getElementById). It also is OO, meaning that you can use it repeatedly on the same page. It can now slide in from the left or right - or two or more menus on a page can do a bit of each! It also has a very interesting feature for some. You can disable its internal styles for any given menu it creates and substitute your own stylesheet. To assist designers in this effort, it has a 'dispstyle' property which can be set true for any given menu and this will give you the style that the script is using, or would use, for that menu written to a large textarea in the middle of the page for inspection and/or copying to your own stylesheet if you wish to disable the internal style generation and modify some things beyond what the configuration properties will allow.
It still follows the format of Dynamic-FX Slide-In Menu (v 6.5) in that it has two external script files and limited required styling for the links themselves. One script is just a configuration file, while the other is the menu builder and contains the movement and all other related functions. The configuration file is now called menuItems.js and is well documented. The first menu uses the defaults and so has few properties defined for it. The second menu declares and documents all of the available properties.
Almost all of a given menu's properties can be skipped when configuring a menu as, the script's defaults will take over in those cases. It also converts most critical dimensions to em's so that changing the browser's text size will not adversely affect the appearance. For the future I am going to look into the possibility of having its motion functions based in whole or in part upon ems to make this effect complete without the current optional polling function (found on Fork and Spoon Helmet and in the public domain as far as I could tell) which takes care of these matters for now by re-initing the menu(s) (not reloading the page) when text size changes, so that the menus don't get out of position off the page or sent into the middle of it. It also behaves well with Opera's Zoom feature but not IE 7's Zoom. But, if simple text resizing is used in IE or FF, the effect is seamless.
Some other features of note:
It takes care of a bug from the original where, if you set the initial top offset for the menu to the same or near the same height as its active scrolling offset, things would get a bit ugly. The links now span the entire area of the cells in which they reside.
I've place the demo on a page that is both wider and taller than most folk's screens so that the positioning effects can be observed.
4) URL TO CODE: http://home.comcast.net/~jscheuer1/side/oo_omni/
Here is a link to the same code with the only difference being that the dispstyle property is set to true (designer mode) for the second (right hand) menu on the page:
http://home.comcast.net/~jscheuer1/side/omni_designer/
I did do a great deal of troubleshooting on this script already but, one never knows what might happen in the real world. So, report any early bugs here or until this script gets included in the library here at DD (if it in fact does).
For help with it, please post to the scripts help or javascript forums.
Bookmarks