Well, the most apparent thing to me is the following:

Originally Posted by
myyoungfamily
Code:
<a href="#" onClick="Show('div1'); Hide('div2','div3');">Why Brush Country</a>
and
[
Code:
function Hide(id){
document.getElementById(id).style.display = "none";
}
Notice, you are calling for mulitple IDs to be hidden, but in the Hide function, you only have one ID that can be. You could either add another in the hide function like so:
Code:
function Hide(id,other) {
document.getElementById(id).style.display = "none";
document.getElementById(other).style.display = "none";
}
or simply rewrite it to only show the one and hide the rest with a "for" loop. See below.
Use the following for each link:
Code:
<a href="#" onClick="ToggleDivs('div1'); return false">Show Div One</a>
and in the head of the document, place the following within the script tag:
Code:
function ToggleDivs(id) {
var divs = document.getElementsByTagName('div');
var d = document.getElementById(id);
for (var i = 1; i<=divs.length; i++) {
if (document.getElementById('div'+i)) {document.getElementById('div'+i).style.display='none';}
}
if (d) {d.style.display='block';}
}
Hope this helps.
Bookmarks