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: Select all
// $("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();
Does anbody has an idea how to solve this problem?
Thanks.
[/addition]