:( The openonclick, Does not work

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mledesma
Beginner
Beginner
Posts: 3
Joined: Thu Dec 18, 2003 6:44 am
Location: Waltham, MA
Contact:

:( The openonclick, Does not work

Post by mledesma »

:( The openonclick, Does not work. I would like to know which is the right value for the attribute. I read your whole site and I could not find the value for that feature.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

I have used openonclick as a menu item property in main menu items, like so:

Code: Select all

with(milonic=new menuname("mainmenu")){
style=mainStyle;
top=10;
left=10;
alwaysvisible=1;
orientation="horizontal";
aI("text=Home;url=http://www.penlink.com/;");
aI("text=Drop;showmenu=drop;openonclick=1;");
aI("text=Search;showmenu=search;openonclick=1;");
aI("text=News;showmenu=news;openonclick=1;");
}
Note that I've set openonclick=1; in the individual items that also have a showmenu. Therefore, the submenu that any of these items will open should open when the menu item is clicked.

As with many menu item properties, you can also use openonclick as a menu style property. For example, if you set

Code: Select all

openonclick=1;
in the mainStyle, for the menu defined above, then you wouldn't need to define the property in each menu item.

Two other things:

(1) From my own testing, it seems that the openonclick property only works in menus that also have alwaysvisible=1 (i.e., "main" menus.) Otherwise, even if a menu uses a style where openonclick is enabled, if that menu is not alwaysvisible, then submenus branching from it will open on mouseover (kind of like a Windows menu structure).

(2) There is a global variable called retainClickValue that you can use to modify the openonclick behavior. If this variable is not defined, or if

Code: Select all

retainClickValue=0;
then each menu item that is set to open a submenu with openonclick must be clicked to open the submenu. But if

Code: Select all

retainClickValue=1;
then you can open the first submenu with a click on the calling item, but once a submenu is open, other submenus from the same "main" menu will open just by mousing over the calling items. This is much like a menu in a Windows application, where you have to click a main menu item to open the submenu, but once a submenu is open, you can simply mouse over other main menu items to open their submenus. Once all submenus are closed (i.e., the user is completely out of the menus), then another click will be required to open a submenu.

If you want to use retainClickValue (I recommend it), then you should set it like so:

Code: Select all

retainClickValue=1;
at the top of your menu_data.js file, where the other global values (like _menuCloseDelay=500;) are set.

Hope that helps,

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 »

I have pointer=arrow
and tried retainClickValue=1; at the top,
I don't see either working.

now in Safari ... not sure of anything at this point.

maz
Post Reply