Tech Support Guy banner

hiding showing divs

1325 Views 3 Replies 2 Participants Last post by  malice
hello i have this script which makes three divs who are hidden appear by clicking each time on a link specified
but i would also like to see any other div disappear since all the divs are placed at the same position

so when i click on the link which makes my div brands appear
i would like to see the divs services and liability disappear
in case they are visible, all divs are by default hidden
heres what i have for brands and services
if i click on the link for services i want the service div to appear and whichever of the other divs which is visible at that moment to disappear.

heres what i got
Status
Not open for further replies.
1 - 1 of 4 Posts
Have you tried checking to see if they are visible?

function hideIt(brands)
{
if(document.getElementById(brands).style.visibility = 'visible')
{
document.getElementById(brands).style.visibility = 'show';
}
}


I prefer

document.getElementById(brands).style.display = 'none';
document.getElementById(brands).style.display = '';
See less See more
1 - 1 of 4 Posts
Status
Not open for further replies.
Top