Skip to content

Instantly share code, notes, and snippets.

@philippkueng
Created May 17, 2012 09:30
Show Gist options
  • Save philippkueng/2717737 to your computer and use it in GitHub Desktop.
Save philippkueng/2717737 to your computer and use it in GitHub Desktop.
<html>
<head>
<title></title>
<script type="text/javascript" language="JavaScript">
function toggleMe02(a){
AlleAus02();
var e = document.getElementById(a);
if(!e)return true;
if(e.style.display === "none"){
e.style.display = "block";
} else {
e.style.display = "none";
}
}
// hier müssen alle Container-IDs eingetragen werden
// die Funktion schaltet alle Boxen auf unsichtbar
function AlleAus02() {
document.getElementById('para01').style.display = "none";
document.getElementById('para02').style.display = "none";
document.getElementById('para03').style.display = "none";
document.getElementById('para04').style.display = "none";
document.getElementById('para05').style.display = "none";
document.getElementById('para06').style.display = "none";
document.getElementById('para07').style.display = "none";
}
</script>
</head>
<body>
<p id='para01' onclick='toggleMe02("para01");'>para01</p>
<p id='para02' onclick='toggleMe02("para02");'>para02</p>
<p id='para03' onclick='toggleMe02("para03");'>para03</p>
<p id='para04' onclick='toggleMe02("para04");'>para04</p>
<p id='para05' onclick='toggleMe02("para05");'>para05</p>
<p id='para06' onclick='toggleMe02("para06");'>para06</p>
<p id='para07' onclick='toggleMe02("para07");'>para07</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment