Re[5]: Context menu and main menu
2004/11/22 10:32
Viewed 19680 times
Replies: 1/4

Just make sure to call DynarchMenu.setup at body onload event; trying to call it earlier might display the above error if for instance hmenu.js hasn't finished loading.

Re[6]: Context menu and main menu
2004/11/22 10:35
Viewed 22112 times
Replies: 1/3

So I have to call 2 DynarchMenu.setups in the onload event in order to get both menus working, is that what you're saying?

last
Re[7]: Context menu and main menu
2004/11/22 11:05
Viewed 24619 times
Replies: 1/2

Yes.  To  give you an example:

<script type="text/javascript">
function init() {
DynarchMenu.setup("page-menu");
DynarchMenu.setup("context-menu", { context: true });
}
</script>

...

<body onload="init()">

...

<ul id="page-menu">
<!-- this will be the main menu bar -->
</ul>

...

<ul id="context-menu" style="display: none">
<!-- this will be the context menu -->
</ul>

Note that I added style="display: none" to the context menu UL to prevent it from displaying during the short period between the momen when page started loaded and the moment onload is called. You can use this technique for the first UL too, but it might be not desirable because the UL should stay visible for browsers where JS is disabled or don't support DynarchMenu.

I hope this helps.

last
Google