SubMenu Positioning - Right alignment

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
uri
Beginner
Beginner
Posts: 3
Joined: Wed May 26, 2004 12:07 am

SubMenu Positioning - Right alignment

Post by uri »

I am trying to align SubMenu items to the right of the MainMenu item instead of the default left, but with no success! (I tried to add menualign="right"; property to the SubMenus).

I am using "Menus built from images" sample (http://milonic.com/menusample18.php).

Thanks in advanced,
URI
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

I tried this, which worked ok for me:

Code: Select all

aI("text=Staff Area;url=staff_area/page.html;align=right");
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Confusing. You say "SubMenu items" to the right. Does that mean individual items within a submenu (e.g., align text right), or the entire submenu itself?

URL (as requested)?
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Re: SubMenu Positioning - Right alignment

Post by kevin3442 »

Hi Uri,
uri wrote:...I tried to add menualign="right"; property to the SubMenus....
menualign works to align all of the menu items as a whole inside of a long, horisontal menu bar (i.e., to center the active part of a horizontal menu that has menuwidth=100%). So it's not the right property.
fredlongworthhighschool wrote:I tried this, which worked ok for me:

Code: Select all

aI("text=Staff Area;url=staff_area/page.html;align=right");
Yes, that works. But it'll only work for text, not for images (and Uri is using an image-based menu). The align property only works on text.

If you want to right-align images within menu items, then use the imagealign property, either in the menu style or in the menu items themselves.

But, as John says, we don't know if that's your goal, or if you want to align the position of the submenu in relation to its parent item.

Kevin
uri
Beginner
Beginner
Posts: 3
Joined: Wed May 26, 2004 12:07 am

Post by uri »

I meant aligning the entire submenu to the right of its parent item, not the text or image of an item.

Thanks a lot for your help...
URI
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

That's more complicated:

http://milonic.com/menu_variables.php


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

Post by kevin3442 »

uri wrote:I meant aligning the entire submenu to the right of its parent item, not the text or image of an item.
Hi Uri,

You can do that with the openstyle property, setting it to "rtl". This is a menu property, so it is applied in each menu you want to affect (in this case, the submenus that branch off of yor main menu). So, for example, if you have a submenu named "Products" which opens from a main menu item, you would use the openstyle property in the "Products" menu definition, like so:

Code: Select all

with(milonic=new menuname("Products")){
style=menuStyle;
openstyle="rtl";
aI("text=Product1;url=product1.htm;");
aI("text=Other Stuff;showmenu=otherstuff;");
}
Now the "Products" submenu will right-align with the parent item in the main menu.

A side effect of using openstyle="rtl" in this way is that the subimage used to indicate the availablility of a third-level submenu from a second-level submenu will be on the left side of the menu item instead of on the default right side. You can counteract this effect (if you want to) by specifying

Code: Select all

subimageposition="right";
in the menu style that is used for your submenus.

Hope that made sense.

Kevin
uri
Beginner
Beginner
Posts: 3
Joined: Wed May 26, 2004 12:07 am

Post by uri »

thanks a lot Kevin, it works!!! stupid me for not finding it in the properties reference.

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

Post by kevin3442 »

uri wrote:thanks a lot Kevin, it works!!!
You're welcome. Happy to help.
uri wrote:stupid me for not finding it in the properties reference.
There are a sh... ummm... lots of properties, and this one is among the less-used ones. So don't feel bad about not seeing it.

Cheers,

Kevin
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Why am I feeling particularly useless lately, I didn't think that would work off a horizontal menu. :|

maz
Post Reply