Cita:
Alguien sabe como puedo poner varios spoilers con este codigo?? cuando copio el codigo para mi segundo espoiler, al dar click me abre el primero =( <script type="text/javascript">
//Ocultar/Mostrar Div's
OCULTO="none";
VISIBLE="block";
function mostrar1(blo) {
document.getElementById(blo).style.display=VISIBLE ;
document.getElementById('ver_off1').style.display= VISIBLE;
document.getElementById('ver_on1').style.display=O CULTO;
}
function ocultar1(blo) {
document.getElementById(blo).style.display=OCULTO;
document.getElementById('ver_off1').style.display= OCULTO;
document.getElementById('ver_on1').style.display=V ISIBLE;
}
</script>
<div id="ver_on1"><h1 id="titu"><a href="#" onclick="mostrar1('bloque1')" title="Expandir info">Expandir</a></h1>
<p class="copete">Haga click en el título para axpandir la información</p>
</div>
<div id="ver_off1" style="display: none"><h1><a href="#" onclick="ocultar1('bloque1')" title="Cerrar info">Contraer</a></h1>
</div>
<div id="bloque1" style="display: none">
<p id="txt">Texto oculto que ahora se ve :)</p>
</div>
//Ocultar/Mostrar Div's
OCULTO="none";
VISIBLE="block";
function mostrar1(blo) {
document.getElementById(blo).style.display=VISIBLE ;
document.getElementById('ver_off1').style.display= VISIBLE;
document.getElementById('ver_on1').style.display=O CULTO;
}
function ocultar1(blo) {
document.getElementById(blo).style.display=OCULTO;
document.getElementById('ver_off1').style.display= OCULTO;
document.getElementById('ver_on1').style.display=V ISIBLE;
}
</script>
<div id="ver_on1"><h1 id="titu"><a href="#" onclick="mostrar1('bloque1')" title="Expandir info">Expandir</a></h1>
<p class="copete">Haga click en el título para axpandir la información</p>
</div>
<div id="ver_off1" style="display: none"><h1><a href="#" onclick="ocultar1('bloque1')" title="Cerrar info">Contraer</a></h1>
</div>
<div id="bloque1" style="display: none">
<p id="txt">Texto oculto que ahora se ve :)</p>
</div>