I have a few hidden divs which reveal themselves "onmousedown." However, you have to click the link twice for the hidden content to disappear. I'd like the content to disappear when you click any other "onmousedown" link on the page, instead of having to click the same link twice. It ends up that, if you don't click the link twice, and you click another onmousedown link, the content becomes nested and overlaps. Here's the code I'm using to toggle visibility:
function toggleVisibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
Here's the jsfiddle. (Forgive me -- for some reason the jquery isn't functioning. Perhaps some expert will see where I copied things incorrectly, but otherwise I think one can see pretty clearly what's going on -- just imagine the hidden content for each div appearing all at once nested below the links.)