WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Help with menu please, i'm stuck, Erik Smit, March 11, 2004
     Re:Help with menu please, i'm stuck, Mattes, March 12, 2004
         Re:Help with menu please, i'm stuck, Erik Smit, March 12, 2004
             Re:Help with menu please, i'm stuck, Mattes, March 12, 2004
                 Re:Help with menu please, i'm stuck, Erik Smit, March 13, 2004

Subject: Re:Help with menu please, i'm stuck From: Erik Smit Date: March 12, 2004

Dear Mattes,

Thanks for the tip.

Your suggestion comes close to the definitive sollution. Instead of using DIV I used SPAN. This gives the menu some more room. The 2 horizontal menubars are now displayed as they are supposed to. To make the trick work, I had to add the following code to the menu definition (see source below):

myBar1.useAutoPosition = false;
myBar2.useAutoPosition = false;

For some strange reason the WebFXMenu objects myMenu1 and myMenu2 are not displayed at the correct location. Depending on the width of the browser they are displayed too far to the right. This might indicate that the calculation is going wrong. Can you help me with that also?

If you want I can mail you the test environment I'm using (complete with CSS and modified xmenu.js).

- Erik


From: Mattes
Sent: March 12, 2004
Subject: Re:Help with menu please, i'm stuck

I suppose you want your menubars to float within the content of your page!? Otherwise you would prefer absolute positioning.
Try this (works with IE and Mozilla):

Use absolute positioning for your menubars, so that you get your wanted layout. Now put them into a DIV, which has relative positioning. Then your menubars are positioned by "top" and "left", but float within the page as they are nested in the outer DIV.
But you have to know and set the height of the outer DIV cause the it does NOT grow as expected. It keeps collapsed with a height of 0, cause the menubars are not "really" in it.

Maybe I am close to your problem.... ;-)


From: Erik Smit
Sent: March 11, 2004
Subject: Re:Help with menu please, i'm stuck

I am trying to build a custom menu with XMenu (1.12). The last part just won't seem to work the way I want it.

here's the menu definition:

var myMenu1 = new WebFXMenu;
myMenu1.add(new WebFXMenuItem( "sub1-1" ));
myMenu1.add(new WebFXMenuItem( "sub1-2" ));

var myMenu2 = new WebFXMenu;
myMenu2.add(new WebFXMenuItem( "sub2-1" ));
myMenu2.add(new WebFXMenuItem( "sub2-2" ));

// 2nd horizontal menu bar
var myBar1 = new WebFXMenuBar;
myBar1.add(new WebFXMenuButton( "Bar1-1", null, null));
myBar1.add(new WebFXMenuButton( "Bar1-2", null, null, myMenu1));
myBar1.add(new WebFXMenuButton( "Bar1-3", null, null, myMenu2 ));

// 2nd horizontal menu bar
var myBar2 = new WebFXMenuBar;
myBar2.add(new WebFXMenuButton( "Bar2-1", null, null ));
myBar2.add(new WebFXMenuButton( "Bar2-2", null, null ));

// main horizontal menu
var myMainBar = new WebFXMenuBarMain;
myMainBar.add(new WebFXMenuButton( "Main1", null, null));
myMainBar.add(new WebFXMenuButton( "Main2", null, null, myBar1));
myMainBar.add(new WebFXMenuButton( "Main3", null, null, myBar2 ));


In the source code I have created a copy of WebFXMenuBar and named it WebFXMenuBarMain. The reason I did this was because they both use different styles (from CSS). Maybe this can be solved otherwise, but I don't know how - any suggestions?

Now, when I use this menu with position defined as absolute (in CSS) everything works fine (when setting top and left values correct). The 2nd horizontal menubars are positioned on the same place - the correct way.
If switched to position defined as relative the myBar1 and myBar2 menus are displayd underneath eachother - the incorrect way for me.
I would like to use this menu in relative mode. How do I get the 2nd horizontal menu to be positioned in one place.

I hope you understand what I am trying to create. If not, excuse me for my bad explanation. I've searched the whole forum for an anwer, but didn't find it. Please help.

- Erik Smit


Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.

View All Messages
Back to WebFX