positioning in cell

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
camz
Beginner
Beginner
Posts: 1
Joined: Mon Apr 21, 2003 6:12 pm

positioning in cell

Post by camz »

hello

i used the following code to position the bar in a cell:
<script language=JavaScript>
PlaceMenu("mainmenu")
</script>

the problem is when the page loads, the bar is first shown on the exact position as defined in the js file. after a very short time the bar is replaced to the wanted position (in the cell). how can i overcome this disturbing 'flash'? i guess by disabling the exact positioning at the start, but how to do this? or is there another was to position the bar in this cell?

thanks
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

The PlaceMenu() function can only bind the menu to a table cell once the table cell has been rendered (i.e., once the body of the document has been processed). Since the menus are among the first things to be displayed, you'll get the flahing problem as the menu jumps from its original location to its table-bound location.

I can suggest two work-arounds.

(1) Toward the top of mmenu.js, there's a variable called loadWait. Normally, loadWait=0. This tells the menus not to wait for the rest of the page. If you change loadWait to 1, the menus should wait until the rest of the page loads to display. You may still get the flash, however... I haven't tried it so I don't know. Also, if you use this approach, you'll have to remember to change that variable each time you download a menu update.

(2) An effective kludge would be to specify a MenuTop and/or MenuLeft position in your main menu array (2nd and 3rd elements respectively), that would initially render the menu off of the visible page. E.g., if you have a horizontal main menu, set its MenuTop location to -200. That way, the menu will be rendered, but it'll be well above the visible page, so the site visitor won't see it until it jumps into the table... no flash from their perspective! This approach also has the advantage that you do not have to edit the mmenu.js file.

Hope that helps,

Kevin
Post Reply