Forum Moderators: open
Here is the URL of a working script so you get a visual:
[gis.esri.com...]
Thanks for any help you can give.
/*---------------------------------------
TESTING TOGGLE SCRIPT
---------------------------------------*/
//use this to collapse/expand lists
function toggle(thisList){
if (document.getElementById(thisList).style.display =="") {
document.getElementById(thisList).style.display = "block";
document.getElementById(thisList + "arrow").className = "selectedCategory";
} else {
document.getElementById(thisList).style.display ="";
document.getElementById(thisList + "arrow").className = "arrow";
}
}
//use this to "show" or "hide" all the things on a collapsable list, at the same time
function toggleAllTag(tagname) {
tagArray = document.getElementsByTagName(tagname);
// produces an array of all objects in the page that are the tag you requested
for (i = 0; i < tagArray.length; i ++) {
if (tagState == "hidden") {
document.getElementById(tagArray[i].id).style.display = "block";
document.getElementById(tagArray[i].id + "arrow").className = "selectedCategory";
} else {
document.getElementById(tagArray[i].id).style.display ="";
document.getElementById(tagArray[i].id + "arrow").className = "arrow";
}
}
tagState = (tagState == "hidden")? "visible" : "hidden";
}
//for some reason the down arrow won't show unless it's preloaded.
var downArrow = new Image();
downArrow.src = "/graphics/sidenavarrowdown.gif";
var rightArrow = new Image();
rightArrow.src = "/graphics/sidenavarrow.gif";
var blueBullet = new Image();
blueBullet.src = "/graphics/sidenavbullet.gif";
//tagState must be defined
tagState = "hidden";
To change the default, you need to edit the CSS that defines the element in the first place. Just make your CSS start as "display:block;" instead of "display:none;" and you'll be all set.
Added: Where are my manners!
Welcome to WebmasterWorld, rose1212!
I'm sure you'll enjoy how helpful this forum is. Also, for future posts, the forum charter [webmasterworld.com] restricts the posting of personal URLs. :)