Would alwaysvisible=0 ever be used?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
blaine
Super Advanced
Super Advanced
Posts: 59
Joined: Mon Apr 05, 2004 11:29 pm

Would alwaysvisible=0 ever be used?

Post by blaine »

Can anyone give me a reason/purpose where the menu option alwaysvisble would ever be 0 for a main menu.

Is it only used for sub-menus when you don't want the main menu to appear when you select a submenu. Even that seems like an awkard and confusing application.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I don't have any idea. It may just be that in programming you have to have on/off 1/0. I think that's how computers work??? 1 on 0 off, binary codes or something, if I remember correctly from something I read decades ago :lol: So, anyway, I think that if you need to give a program two options, 1 on and 0 off, then you'd program it to understand that if it is coded 1 do this, if nothing is coded assume 0. In this case the default setting, that is what the program assumes if alwaysvisible is not set to 1, is 0. That is, if you don't have alwaysvisible coded to 1 and you don't have alwaysvisible coded to 0, then the program understands that it is 0, or not visible. As you can see by all my 'I thinks' this is only a 'guess' there may actually be some menu setups that require all of it to be codes, on and off, maybe for things like the extras menus, php, or mysql stuff.

Ruth
blaine
Super Advanced
Super Advanced
Posts: 59
Joined: Mon Apr 05, 2004 11:29 pm

Post by blaine »

Oh, my question was not about using 0 or 1 vs on of off. It's why or when is ever used to set the property alwaysvisble to 0 or off. I am in fact creating the menu's programatically from mysql via php but that should not be relevant.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Well, as I said, I don't know other than the guess I made about mysql and such. As far as I know you could go ahead and put in alwaysvisible=0; into all the submenus if you want.

Maybe it has to do with making personalized functions. There are some functions that have been created for things users in the forums wanted. They were created by Kevin who used to be able to help here, but unfortunately isn't able anymore.

This is to change menu properties using whatever this function is. At the bottom of the page is a link to 'other demos' using this function for other properties to change, the first one on that other demos page is changing alwaysvisible from 1 to 0. If you click the Alwaysvisible it will go to a page and that 'item' is no longer visible. I can't tell you much more since I am not js knowledgeable.



http://support.milonic.com/demos/change ... /index.htm
blaine
Super Advanced
Super Advanced
Posts: 59
Joined: Mon Apr 05, 2004 11:29 pm

Post by blaine »

Thanks Ruth and I guess that demo you pointed me too, also answers my other question I posted today about the reference number in the menu property guide.

Example function call: mm_changeMenuProperty("main menu", 7, 0);

The property 7 is the menu property alwaysvisible.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You're welcome. There are a lot of demos that were done for users who posted here in the forum. Maybe some would be something of interest to you. I should have dropped the link to the main page

http://support.milonic.com/demos/

Only the ones in the top section were done from forum posts and they have no support since they were not created by Milonic. The one I play with a lot is the IE Filters one.

The ones at the bottom are from modules created by Milonic.

Ruth
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

alwaysvisible is 0 by default and so it's not required unless you want the value to be 1

It basically denotes a main menu or not a main menu. Declaring alwaysvisible=0; is fine and acceptable just not very efficient.
blaine
Super Advanced
Super Advanced
Posts: 59
Joined: Mon Apr 05, 2004 11:29 pm

Post by blaine »

Andy,

I'm curious why the default is hidden. Would most users not want the menu visible?
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

It's not that the default is hidden it's just that it's not needed so we don't bother to add it to the menu definitions.

There are currently 114 style and item properties and 33 menu properties. We couldn't possibly include them all in a menu or menu item object so the standard practice is to only declare properties that we need to change.

with alwaysvisible (and other properties) you only need to include it if you want the value to be other than zero
blaine
Super Advanced
Super Advanced
Posts: 59
Joined: Mon Apr 05, 2004 11:29 pm

Post by blaine »

Sorry Andy, let me rephrase that question.

Sounds like the default for this propoery "alwaysvisible" is 0 (hidden - do not show). And thus when creating the menu we need to include the property to have the menu appear.

with(milonic=new menuname("Site Menu")) {
position="relative";
alwaysvisible=1;';

Would we not 99% of the time want the menu to appear - thus why os the default 0?
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

I think it's the name of the property causing confusion.

Think of alwaysvisble being the same as mainmenu - A main menu needs to be alwaysvisible whereas a sub menu does not.

Hope this helps,
Andy
blaine
Super Advanced
Super Advanced
Posts: 59
Joined: Mon Apr 05, 2004 11:29 pm

Post by blaine »

Uh, ok - thanks that helped :)
Post Reply