horizontal center

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Silverion
Advanced
Advanced
Posts: 13
Joined: Sun Aug 31, 2003 8:15 pm

horizontal center

Post by Silverion »

I tried the general help i got in my last post, but it didnt help

can someone give me the exact thing I need to do in order to center position my menu, but to have the top alignment absolute?

my code from menu_data.js is the following:
...
with(milonic=new menuname("Main Menu")){
style=menuStyle;
top=45;
left=325;
alwaysvisible=1;
orientation="horizontal";
position="absolute";
...
[/quote]
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Try:

Code: Select all

with(milonic=new menuname("Main Menu")){ 
style=menuStyle; 
top=45; 
screenposition="center";
alwaysvisible=1; 
orientation="horizontal"; 
...item definitions...
}
Note the removal of the left and position properties, and the addition of the screenposition property.

Hope that helps,

Kevin
Silverion
Advanced
Advanced
Posts: 13
Joined: Sun Aug 31, 2003 8:15 pm

makes more problems

Post by Silverion »

when I do that, it causes it to be centered, but everytime the browser is resized, the height of the actual menu itself grows. help!

example: http://digital.dyns.net

edit: I also need a left offset from center to put it in the right place
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi,

I think the root of the problem is that you're using RC7. There have been a few improvements since 7. The current release is RC30; you can get it here (note that you must log in before you can download). Once you unzip the download file, upload milonic_src.js, mmenudom.js, and mmenuns4.js to your web server, replacing the older version of these three files with the new ones you downloaded.

I tried your code with RC30, and it works without growing the menu. Since the scriptpath variable was removed from the menu source code, you'll have to edit your html file a little. Replace the following:

Code: Select all

<script language="JavaScript" src="milonic_src.js" type="text/javascript"></script>
<script language="JavaScript" src="menu_data.js" type="text/javascript"></script>
with this:

Code: Select all

<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script	language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
You might also want to read the .txt files that come with the download.

Hope that helps,

Kevin
Silverion
Advanced
Advanced
Posts: 13
Joined: Sun Aug 31, 2003 8:15 pm

Post by Silverion »

now I just need to remove the 'milonic menu' thing and also to add a center offset...can you help?
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Yep... I can help!

As for removing the "Milonic Menu" thing, the only way to do that is to license the software. You can obtain a free license if you are a non-profit organization or if it's a personal website (there is, however, a small admin. fee to cover Milonic's costs to verify that it is indeed a non-profit site.) You can check out various links in the forum or on the site for more info. Here are some places to start:

http://milonic.com/nplicense.php

http://milonic.com/forum/viewtopic.php?t=2760

http://milonic.com/licfaq.php

http://milonic.com/ (scroll down the page to "The Free Downloads are Back")

As for a center offset... what is it you'd like to do... offset in which direction and by how much? Heading home now, so probably see you tomorrow.

Cheers,

Kevin
Silverion
Advanced
Advanced
Posts: 13
Joined: Sun Aug 31, 2003 8:15 pm

Post by Silverion »

probably an offset to the right, the end of the menu has to come before the tilt in the red line on the graphic
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Ahh yes... I see. That'll look nice. You'll have to put the the left property back in the menu definition, then use it to offset to the right. Like so:

Code: Select all

left="offset=104";
The value (e.g., 104 above) is in pixels. A positive value offsets to the right; negative to the left.

Hope that helps,

Kevin
Silverion
Advanced
Advanced
Posts: 13
Joined: Sun Aug 31, 2003 8:15 pm

Post by Silverion »

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

Post by kevin3442 »

You're welcome.
Post Reply