Jump to content

Show Hide Div


GoDxNero

Recommended Posts

Well I am currently using this java script:

function toggle(element) {if (document.getElementById(element).style.display == "none")   {   document.getElementById(element).style.display = "block";   }   else   {   document.getElementById(element).style.display = "none";   }}

How can I make it so that when I start a new function toggle, the previous ones get reset back to invis ? What I mean is that if I got 2+ div ( all vision = invisible ) . Once I click on the first button the first div will appear and when I click the second button the second div will appear together with the first and just like that with the third div and so on... But I want so that once I click the other button it will be the only one that show up and the rest which vision=visible turn back to invisible. Do you guys know a methods work with alots div this way ? Thanks alots in advance !

Link to comment
Share on other sites

You could also have a look at the show/hide script here, along with other javascript snippets:http://w3schools.invisionzone.com/index.php?showtopic=9500Shown in practice here:http://www.iribbit.net/i/_files/javascript-snippets.htm

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...