Heavens_Candy
04-25-2005, 06:50 AM
Script: DD Switch Menu
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm
Hi, I hope you can help me out with this and I am explaining it correctly.. :eek: I am using the DD Switch Menu, but I would like to be able to click on a menu, it drops down. Then I click on another one and it drops down while the other one stays open...and so on for the rest of the menus. If you click on a menu that is already open just that one closes. Now I figured that out buy just putting in this code below:
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
</script>
BUT Now there is no cookie set...so if I go to another page and then go back to that page all of them are closed again. :( I want the ones I have left dropped down to still be in that state upon going back to that page.
Thanks for any help!
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm
Hi, I hope you can help me out with this and I am explaining it correctly.. :eek: I am using the DD Switch Menu, but I would like to be able to click on a menu, it drops down. Then I click on another one and it drops down while the other one stays open...and so on for the rest of the menus. If you click on a menu that is already open just that one closes. Now I figured that out buy just putting in this code below:
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
</script>
BUT Now there is no cookie set...so if I go to another page and then go back to that page all of them are closed again. :( I want the ones I have left dropped down to still be in that state upon going back to that page.
Thanks for any help!