Menu must disappear when you click anywhere on the page

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Silent1
Beginner
Beginner
Posts: 4
Joined: Fri Oct 21, 2005 9:21 pm

Menu must disappear when you click anywhere on the page

Post by Silent1 »

These are the options i have,
openonclick=1;
closeonclick=1;
keepalive=1;

My client wants the menu to open when you click on a menu item and click to close it. Is there any way to keep these settings and have it so if they click anywhere on the page, besides the menu, the menu will collapse/close?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I'm not really sure since you have the keepalive=1; There were a couple of topics I found with functions that had to do with keepalive and/or closing submenus but I don't know if the functions can be used as you want.


viewtopic.php?p=25111

viewtopic.php?p=26924

Ruth
Silent1
Beginner
Beginner
Posts: 4
Joined: Fri Oct 21, 2005 9:21 pm

Post by Silent1 »

the first link provided a function, who do i use it with the code below.
function closeAllKeepAliveMenus()
{
for(_a=0;_a<_m.length;_a++)
{
if(_m[_a][10])menuDisplay(_a,0)
}
}

aI(openonclick=1;closeonclick=1;keepalive=1;showmenu=Menu;text=Menu;url=index.html);

Thanks.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I'm sorry, I don't know. Since you already have openonclick and closeonclick I don't think you can use clickfunction=closeAllKeepAliveMenus(); because it would close it even when you clicked the first time to open it, I think. And, you have a url=index.htm so you can't use url=javascript:closeAllKeepAliveMenus(). Those are the only ways I know to use the functions.

I'll try and see if I can find anything anywhere on how you'd use that. You might post a reply in the post with the function asking how you'd use it and posting your aI again.

By the way, the aI is incorrect. You have left out " marks

Code: Select all

aI("openonclick=1;closeonclick=1;keepalive=1;text=Menu;url=index.htm;");
Ruth
Post Reply