Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:22

Right-align submenus to main menu using popup()


Poster: zupac
Dated: Wednesday December 7 2005 - 9:52:04 GMT

Hello,

I've searched the forum and tried every solution posted, and yet nothing seems to work... :( I need to align my submenus to the right side of their parent menu items. I've tried align="right" and openstyle="rtl" to no avail.

I have a main menu that has several links which use the popup() and popdown() method:
Code:
<div onMouseOver="popup('newsmenu','nmenu');" onMouseOut="popdown();"><a href="#" name="nmenu" id="nmenu">للإعلاميين</a></div>


Here is the menu_data.js file:
Code:
_menuCloseDelay=500
_menuOpenDelay=150
_subOffsetTop=10
_subOffsetLeft=-10

with(menuStyle=new mm_style()){

   offcolor="#336699";
   offbgcolor="#CCDDEE";
   oncolor="#FFFFFF";
   onbgcolor="#6699CC";

   bordercolor="#336699";
   borderstyle="solid";
   borderwidth=1;
   separatorcolor="#336699";
   separatorsize="1";
   padding="3 5 4 20";
   fontsize="11px";
   fontfamily="Tahoma, Trebuchet MS, sans-serif";
   fontstyle="normal";

   pagecolor="black";
   pagebgcolor="#82B6D7";
   headercolor="#000000";
   headerbgcolor="#FFFFFF";

   subimage="menu/arrow.gif";
   subimagepadding="3";
   overfilter="";
   outfilter="";
   openstyle="rtl";
   align="right";
}

with(milonic=new menuname("newsmenu")){
   style=menuStyle;
   top=3;
   left=-6;
   openstyle="rtl";
   align="right";
   aI("text=إصدارات الصحف;url=press_releases.php;");
}


It still aligns to the left side... any suggestions?


Poster: Ruth
Dated: Thursday December 8 2005 - 4:07:28 GMT

Hi,

I'd need to see the page layout so I can figure out how to do what you want. You can position the submenus when using popup by using a transparent image and having the popup refer to that image. But without the layout I'm not sure if you can fix the image so that the menu right aligns. Youc an also position it using offsets with the popup. Information on that can be found in the Methods and Functions page. The pop up is down at the bottom.

Also there is an sample using the popup menu function positioned by images.

Hope this helps.

Ruth


Poster: zupac
Dated: Monday January 2 2006 - 10:25:54 GMT

Hi Ruth,

Thanks for your response, and I've checked the two pages that you suggested, but I wasn't able to make the menus right-align. According to the specifications of the popup function, there is no option for pop-up menus to right-align. Is that correct?

Quote:
popup ( string Menu_Name, [position 1=Mouse Coords or imageName by image location], [integer Top_Offset], [integer Left_Offset], [Boolean Disable_Collision_Detection], [Integer Open_Menu_Delay] )
popup displays a sub menu by name in several locations. If just the menu name is declared as in popup("menuname"); this will display the menu at the top and left positions specified in the data file. If a 1 is specified as the second parameter the sub menu appears at the mouseX and mouseY coordinates.

If the menu needs to be positioned in relating to an image, you can add this image name as the second parameter. like this popup("menuname","imagename");

Top and Left offsets are permitted to fine tune the positioning. These are entered as pixel values to the 3rd and 4th parameters, like this: popup("menuname","imagename",10,-10); this will place the sub menu at the images left bottom corner but adjust its top position down 10 [10] pixels and shift it to the left by 10 [-10] pixels
In order to add a delay to opening popup Menus, you need to specify this delay (in milliseconds) to the 6th Parameter. An example is popup('menuname',null,null,null,null,500)


I guess I could change the way that the menus are drawn so that openstyle="rtl" or align="right" would work, but I'd like to make it work with popup menus, if at all possible.

Thanks again for your help.

Zu


Poster: Ruth
Dated: Monday January 2 2006 - 12:10:21 GMT

Hi,

You're not using images, so the positioning can't be fine tuned using the top and left offsets, as far as I know. With an image, you'd just set the left offset based on the image width and the submenu width to get it to align that way.

Also, I don't know if that will even work since you are way down level on the menu. I don't know if that was implemented back that far and we won't be able to help since it's so far back, we wouldn't know what can and can't be done at that level. There have been a lot of things added.

You need to upgrade, but make sure you back up your milonic_src, mmenudom, mmenuns4 files someplace and check your expiration date for updates. We are now at 5.739, that's a pre-release but that's what you should get, there was a bug fix in it.

Ruth


Poster: Ruth
Dated: Monday January 2 2006 - 12:13:51 GMT

By the way, if you're using popup because you want to have each of the 'links' in a different table cell, you can still do that with a regular menu, you just create different 'main' menus for each cell. All menus in the Milonic menu are in effect the same, they can all be main menus, just by adding alwaysvisible=1; and the top/left or in a table, relative position settings.

You can either put each in the cell or put each in its own file and call the file.

In the cell you'd put it in script tags. Below my name are links for putting a menu in a table. You'd just have to make sure they each said orientation="horizontal"; so that the submenus would open down.

Ruth


Poster: zupac
Dated: Monday January 2 2006 - 12:30:46 GMT

Thank you for the tips; I will try to implement them soon and keep you posted!

Great tips!


Poster: zupac
Dated: Sunday January 8 2006 - 13:44:01 GMT

Hello Ruth,

I did as you advised, and changed it to a normal menu, without popups. The right-align is now finally working! Thanks :D

The problem now is that I have to deal with black underlines in the main menu and a large indent on the first (from the right) sub-menu item. I haven't had time to check into these issues thoroughly, but I'll check them tomorrow and hope that everything is working then.

Just wanted to say thanks again, and I really appreciate your time and help.

Best wishes,
Zu


Poster: zupac
Dated: Monday January 9 2006 - 10:45:19 GMT

update: now the lines are gone, but the only way I found to make the indent go away was to shorten the length of one of the items in the sub-menu. now it's working very well :D