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:35

pb : openstyle="up" & popup() function


Poster: bill-gudule
Dated: Monday March 29 2004 - 16:06:48 BST

:?
When I use the openstyle="up" option for a menu, and then call the popup function to show this menu, the menu appears down the location of the mouse or object and not up...

Can someone help me fixes this problem ?

Thanks !


Poster: Maz
Dated: Monday March 29 2004 - 18:39:05 BST

Beyond me, but something changed.

I'll just add a note, that on my screenposition right menu, it doesn't seem to make any difference if I use openstyle="rtl"; 'Rate Article' which is images and type=form; is opening center on first mouse over, after that it corrects itself.

maz

Re: pb : openstyle="up" & popup() function


Poster: kevin3442
Dated: Tuesday March 30 2004 - 3:19:00 BST

bill-gudule wrote:
:?
When I use the openstyle="up" option for a menu, and then call the popup function to show this menu,...

The openstyle property has no effect on the popup() function, which is meant to work as you describe (see a description of popup() on this page.) popup() is generally meant to let you open a menu apart from any calling menu; e.g., open a menu at the current pointer location or at an image location.

The openstyle property affects the direction a menu will open when it is called with a menu item's showmenu propery, which is the standard way to open a submenu from a higher-level menu item, like so...
Code:
aI("text=Item Text;showmenu=subMenuName;");

where subMenuname is the name of a menu defined in your meu_data.js file. The named submenu will open upward from the calling menu item if openstyle is set to "up".

Hope that helps,

Kevin

Re: pb : openstyle="up" & popup() function


Poster: bill-gudule
Dated: Tuesday March 30 2004 - 8:57:04 BST

kevin3442 wrote:
The openstyle property has no effect on the popup() function, which is meant to work as you describe (see a description of popup() on this page.) popup() is generally meant to let you open a menu apart from any calling menu; e.g., open a menu at the current pointer location or at an image location.

Hope that helps,

Kevin


No Kevin I'm sorry but it does not help : it's not a sort of solution but a validation of my problem ! ;)

I just think that popup() function should take care of the openstyle="up".

I tried the code below but it does not work the first time : gpos() returns invalid values for height & width...

Code:
   onmouseover="
          menuID=getMenuByName('m_1');
           menuObj=gmobj('menu'+menuID);
           mn_pos=gpos(menuObj);
           im_pos=gpos(gmobj('img_ong_1'));
           spos(menuObj,im_pos[0]-mn_pos[2]-10,MouseX);
           menuDisplay(menuID,1);
          "
   onmouseout='popdown()'


There's probably something wrong in my code, but what ?

Thanks for help !

Eric

I have the same problem !


Poster: somorgujo
Dated: Thursday May 27 2004 - 19:07:49 BST

Have you found a solution to this ????

Re: I have the same problem !


Poster: kevin3442
Dated: Thursday May 27 2004 - 21:28:11 BST

somorgujo wrote:
Have you found a solution to this ????

Hi somorgujo,

Yes indeed! There are in fact a couple of solutions available. They were available back when bill-gudule posted the problem (e.g., fixing the problem in bill-gudule's code, or using popup() in a slightly different way), but I typically stop responding when someone unnecessarily gives me a smart ass reply when I'm trying to help.

But since you are asking nicely... ;)

I'm not sure what your exact goal is, so I'll assume that you want to use popup() to open a menu at the mouse pointer's position, but you want it above the pointer rather than the default below.

The call to popup() supports a variety of parameters. One of the variations is to pass a "top offset" and/or a "left offset" that will adjust the menu's default opening position. In a call like the following
Code:
popup('Products', 1, -150, -10);

The first parameter ('Products') is the name of the menu to open. The second parameter (1), tells the function to use the current pointer location as a base opening location for the upper-left corner of the menu. The third parameter (-150) is the Top Offset; negative values move the menu up, positive move it down, from the base opening location. The fourth parameter (-10) is the Left Offset; negative values move the menu left, positive move it right, from the base opening location. Offsets are given in pixels by default. So in the above example, the menu named "Products" would open 150px above and 10px to the left of the mouse pointer. This would place a menu that is 150px high completely above the pointer (and slightly to the left). If you just want to move the menu up, with no Left Offset, then just pass three parameters.

With the above method, you have to adjust the menu's opening position explicity, by passing the approriate offsets. This means that you'll need to know the sizes of the menus ahead of time (no big deal if you only have a few menus; a little trial and error is all it takes). If you'd rather make the adjustments programatically, at run time, you can also do that. This is what bill tried to do. If that's what you want to do, let me know and I'll give you a hand.

Hope that helps,

Kevin

Now the sub menus are the headache !!


Poster: somorgujo
Dated: Friday May 28 2004 - 15:38:34 BST

Thank you very much for your prompt answer!

I think with the first method I should be fine, since I don't have a lot of menues.

Now I'm trying to get the sub menus to display right but they insist to show downwards :-)

I tried setting the _subOffsetTop to a negative value, but this is global and in that case all my submenues should have the same high, right?

When I set the openstyle property to "rtl" it work but when I put it to "up" or to "uprtl" it doesn't :-(

Is it a bug? I have the latest version of the script. Because in you first post you said it should work when you use it from a showmenu call, right?

So you can make yourself a better picture here a snapshot of the design I'm trying to achieve.

Image

http://homepage.sunrise.ch/mysunrise/vk ... enu_ex.jpg

Here the code I'm using:

Code:
with(milonic=new menuname("Milonic")){
style=menuStyle;
aI("text=Product Purchasing Page;showmenu=Partners;url=http://www.milonic.com/cbuy.php;");
aI("text=Contact Us;url=http://www.milonic.com/contactus.php;");
aI("text=Newsletter Subscription;url=http://www.milonic.com/newsletter.php;");
aI("text=FAQ;url=http://www.milonic.com/menufaq.php;");
aI("text=Discussion Forum;url=http://www.milonic.com/forum/;");
aI("text=Software License Agreement;url=http://www.milonic.com/license.php;");
aI("text=Privacy Policy;url=http://www.milonic.com/privacy.php;");
}

with(milonic=new menuname("Partners")){
style=menuStyle;
openstyle="up";
aI("text=(aq) Web Hosting;url=http://www.a-q.co.uk/;status=(aq) Web Server Hosting & Services;");
aI("text=SMS 2 Email;url=http://www.sms2email.com/;");
aI("text=WebSmith;url=http://www.softidiom.com/;");
}


It doesn't match the design yet but i'm first trying to get the menu to do what I need :-)
Thanks again !