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:34
Forcing submenu to remain active after clicking an item
Poster: easyred
Dated: Tuesday May 29 2007 - 8:55:39 BST
Hi folks,
i'm tryin to create a milonic menu (main menu and submenu) made up from checkboxes and corresponding labels.
A click to an submenu item calls a javascript function ("url=toggleCheckboxes();"), there is no load of an page, and the function toggles only checked/unchecked state (unchecks main menu if no items in corresponding submenue are checked).
I want the submenu to remain active and visible after clicking a submenu item. How can i force this?
Searched this forum for some solutions, have also tried things like retainClickValue=1, closeonclick=0; and keepalive=1; added openBranchByName() at the end of my toggleCheckboxes() function, but nothing helped.
Any suggestions please?
easyred
[addition]
Ok, whe i use closeonclick, the submenu will remain active and closes on going out from the submenu or by clicking elsewhere on the document. But this works on IE7 and not on FF2.
Code:
// $("foo") is from protopype
var subrubrics = $("subrubrics").value;
subrubrics = subrubrics.split("|");
var aSubrubrics = new Array();
for (var i=0; i < subrubrics.length; i++) {
aSubrubrics[subrubrics[i]] = 1;
}
fixMozillaZIndex=true; //Fixes Z-Index problem with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;
with(menuStyleMainCheckboxes=new mm_style()){
fontfamily="Arial, Verdana, Tahoma";
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ff9b00";
headercolor="white";
margin:0;
offbgcolor="#ff9b00";
offcolor="white";
onbgcolor="#ff9b00";
oncolor="white";
outfilter="randomdissolve(duration=0.3)";
padding=0;
pagebgcolor="#ff9b00";
pagecolor="black";
separatorcolor="#ff9b00";
separatorsize=15;
subimage="/_common/img/shim.gif";
subimagepadding=1;
}
with(menuStyleCheckboxes=new mm_style()){
bordercolor="#ff9b00";
borderstyle="solid";
borderwidth=0;
fontfamily="Arial, Verdana, Tahoma";
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ff9b00";
headercolor="white";
offbgcolor="#ff9b00";
offcolor="white";
onbgcolor="#ff9b00";
oncolor="white";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=95);";
padding=2;
pagebgcolor="#ff9b00";
pagecolor="black";
separatorcolor="#ffcd80";
separatorsize=1;
subimage="/_common/img/shim.gif";
subimagepadding=1;
itemwidth=150;
closeonclick=0;
}
with (milonic = new menuname("catMain")) {
alwaysvisible=1;
orientation="horizontal";
position="relative";
style=menuStyleMainCheckboxes;
aI("showmenu=subcat:6;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['6']) ? " checked='checked'" : "") + " name='szcatchk[6]' id='szcatchk_checkbox:6' /><label for='szcatchk_checkbox:6' class='categoryMenuItemLbl'>Entertainment</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:6');status=Entertainment;");
aI("showmenu=subcat:5;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['5']) ? " checked='checked'" : "") + " name='szcatchk[5]' id='szcatchk_checkbox:5' /><label for='szcatchk_checkbox:5' class='categoryMenuItemLbl'>Culture</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:5');status=Culture;");
aI("showmenu=subcat:4;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['4']) ? " checked='checked'" : "") + " name='szcatchk[4]' id='szcatchk_checkbox:4' /><label for='szcatchk_checkbox:4' class='categoryMenuItemLbl'>Sport</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:4');status=Sport;");
aI("showmenu=subcat:2;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['2']) ? " checked='checked'" : "") + " name='szcatchk[2]' id='szcatchk_checkbox:2' /><label for='szcatchk_checkbox:2' class='categoryMenuItemLbl'>more ...</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:2');status=more ...;");
}
with(milonic=new menuname("subcat:2")){
style=menuStyleCheckboxes;
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:18']) ? " checked='checked'" : "") + " name='szcatchk[18]' id='szcatchk_checkbox:2:18' /><label for='szcatchk_checkbox:2:18'>Circus</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:18');status=Circus;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:35']) ? " checked='checked'" : "") + " name='szcatchk[35]' id='szcatchk_checkbox:2:35' /><label for='szcatchk_checkbox:2:35'>Children</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:35');status=Children;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:34']) ? " checked='checked'" : "") + " name='szcatchk[34]' id='szcatchk_checkbox:2:34' /><label for='szcatchk_checkbox:2:34'>Party</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:34');status=Party;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:33']) ? " checked='checked'" : "") + " name='szcatchk[33]' id='szcatchk_checkbox:2:33' /><label for='szcatchk_checkbox:2:33'>Expositions</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:33');status=Expositions;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:30']) ? " checked='checked'" : "") + " name='szcatchk[30]' id='szcatchk_checkbox:2:30' /><label for='szcatchk_checkbox:2:30'>Further...</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:30');status=Further...;");
}
with(milonic=new menuname("subcat:4")){
style=menuStyleCheckboxes;
...
}
with(milonic=new menuname("subcat:5")){
style=menuStyleCheckboxes;
...
}
with(milonic=new menuname("subcat:6")){
style=menuStyleCheckboxes;
...
}
drawMenus();
var subrubrics = $("subrubrics").value;
subrubrics = subrubrics.split("|");
var aSubrubrics = new Array();
for (var i=0; i < subrubrics.length; i++) {
aSubrubrics[subrubrics[i]] = 1;
}
fixMozillaZIndex=true; //Fixes Z-Index problem with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;
with(menuStyleMainCheckboxes=new mm_style()){
fontfamily="Arial, Verdana, Tahoma";
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ff9b00";
headercolor="white";
margin:0;
offbgcolor="#ff9b00";
offcolor="white";
onbgcolor="#ff9b00";
oncolor="white";
outfilter="randomdissolve(duration=0.3)";
padding=0;
pagebgcolor="#ff9b00";
pagecolor="black";
separatorcolor="#ff9b00";
separatorsize=15;
subimage="/_common/img/shim.gif";
subimagepadding=1;
}
with(menuStyleCheckboxes=new mm_style()){
bordercolor="#ff9b00";
borderstyle="solid";
borderwidth=0;
fontfamily="Arial, Verdana, Tahoma";
fontsize="11px";
fontstyle="normal";
headerbgcolor="#ff9b00";
headercolor="white";
offbgcolor="#ff9b00";
offcolor="white";
onbgcolor="#ff9b00";
oncolor="white";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=95);";
padding=2;
pagebgcolor="#ff9b00";
pagecolor="black";
separatorcolor="#ffcd80";
separatorsize=1;
subimage="/_common/img/shim.gif";
subimagepadding=1;
itemwidth=150;
closeonclick=0;
}
with (milonic = new menuname("catMain")) {
alwaysvisible=1;
orientation="horizontal";
position="relative";
style=menuStyleMainCheckboxes;
aI("showmenu=subcat:6;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['6']) ? " checked='checked'" : "") + " name='szcatchk[6]' id='szcatchk_checkbox:6' /><label for='szcatchk_checkbox:6' class='categoryMenuItemLbl'>Entertainment</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:6');status=Entertainment;");
aI("showmenu=subcat:5;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['5']) ? " checked='checked'" : "") + " name='szcatchk[5]' id='szcatchk_checkbox:5' /><label for='szcatchk_checkbox:5' class='categoryMenuItemLbl'>Culture</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:5');status=Culture;");
aI("showmenu=subcat:4;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['4']) ? " checked='checked'" : "") + " name='szcatchk[4]' id='szcatchk_checkbox:4' /><label for='szcatchk_checkbox:4' class='categoryMenuItemLbl'>Sport</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:4');status=Sport;");
aI("showmenu=subcat:2;text=<div><input type='checkbox' class='categoryMenuItemChk' value='1' " + ((aSubrubrics['2']) ? " checked='checked'" : "") + " name='szcatchk[2]' id='szcatchk_checkbox:2' /><label for='szcatchk_checkbox:2' class='categoryMenuItemLbl'>more ...</label></div>;clickfunction=sztCategories.toggle('szcatchk_checkbox:2');status=more ...;");
}
with(milonic=new menuname("subcat:2")){
style=menuStyleCheckboxes;
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:18']) ? " checked='checked'" : "") + " name='szcatchk[18]' id='szcatchk_checkbox:2:18' /><label for='szcatchk_checkbox:2:18'>Circus</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:18');status=Circus;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:35']) ? " checked='checked'" : "") + " name='szcatchk[35]' id='szcatchk_checkbox:2:35' /><label for='szcatchk_checkbox:2:35'>Children</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:35');status=Children;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:34']) ? " checked='checked'" : "") + " name='szcatchk[34]' id='szcatchk_checkbox:2:34' /><label for='szcatchk_checkbox:2:34'>Party</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:34');status=Party;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:33']) ? " checked='checked'" : "") + " name='szcatchk[33]' id='szcatchk_checkbox:2:33' /><label for='szcatchk_checkbox:2:33'>Expositions</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:33');status=Expositions;");
aI("text=<div><input type='checkbox' value='1' " + ((aSubrubrics['2:30']) ? " checked='checked'" : "") + " name='szcatchk[30]' id='szcatchk_checkbox:2:30' /><label for='szcatchk_checkbox:2:30'>Further...</label></div>;clickfunction=sztCategories.toggleChild('szcatchk_checkbox:2:30');status=Further...;");
}
with(milonic=new menuname("subcat:4")){
style=menuStyleCheckboxes;
...
}
with(milonic=new menuname("subcat:5")){
style=menuStyleCheckboxes;
...
}
with(milonic=new menuname("subcat:6")){
style=menuStyleCheckboxes;
...
}
drawMenus();
How can i get this work on FF2?
Does anbody has an idea how to solve this problem?
Thanks.
[/addition]
Poster: Ruth
Dated: Tuesday May 29 2007 - 17:29:42 BST
Hi,
There is a demo for either setting up the Milonic menu to emulate a select box or to be able to put the menu inside a form. I'm not sure if this will help, but I know the one for emulating a select box within the menu works leaving the submenu open until you click the main menu item again. I have no idea if this is something helpful or not.
The one you want, I think, is the top text link at the left changeParentText Sample
http://support.milonic.com/demos/select_box/index.htm
If it isn't I suggest you contact Milonic to see if the menu can do what you want. If you are a pro license or above user, you can use the support system to set up a ticket. At the bottom of the Main site there is a text link to Tech Support that takes you to the beta support ticket system
http://www.milonic.com/
Ruth
Poster: easyred
Dated: Tuesday May 29 2007 - 22:05:48 BST
Hi Ruth,
thanks for your answer. I'll check if i can use something from the selectbox sample.
A support ticked is created, i'm waiting for an answer and have also tried to ask in this forum.
easyred
Poster: Ruth
Dated: Wednesday May 30 2007 - 4:55:23 BST
Hi easyred,
I just wanted you to know that there isn't anyone who does functions that volunteers on the forum now. Kevin did most of those demo functions but he hasn't been able to spend any time here lately, and I am function creation illiterate
Ruth
It works after update
Poster: easyred
Dated: Wednesday May 30 2007 - 9:17:39 BST
Hello together,
have updated to Milonic version 5.774 (from 5.772) a little while ago and now it works fine
easyred
Poster: Ruth
Dated: Wednesday May 30 2007 - 14:50:50 BST
Hi,
That's great. And, if you want to be notified when updates are done, just go to this post and click on watch this topic.
http://www.milonic.com/forum/viewtopic.php?t=3108
Ruth