Ciao a tutti,
stò cercando di utilizzare questo script:
<script type="text/javascript" language="javascript">
function toggleBox(id){if(!document.getElementById) return; var box = document.getElementById(id);
if(box.className = 'box_hidden') box.className = 'box_visible';
else box.className = 'box_hidden'; }
</script>
che si collega a questo css:
<style type="text/css" >
body {
font: 11px sans-serif;
color:#FFFFFF;
background-color: #000000;
}
.boxhead {width:740px; padding:2px 10px; background-color: #666666; border:1px solid #666; margin-bottom:0; cursor: pointer; font-weight:bold; }
.box_visible {width:740px; padding:5px 10px; border:1px solid #666; margin-top:0; }
.box_hidden {display: none;}
</style>
che ha poi il richiamo nel body:
<p onclick="toggleBox('box1')" class="boxhead">Box 1</p>
<p id="box1" class="box_visible">CONTENUTO</p>
<p onclick="toggleBox('box2')" class="boxhead">Box 2</p>
<p id="box2" class="box_visible">CONTENUTO</p>
Ovviamente non funziona...
qualcuno mi sa dire dove sbaglio???![]()