Ver Mensaje Individual
  #7 (permalink)  
Antiguo 02/11/2007, 14:03
Avatar de DragonX
DragonX
Colaborador
 
Fecha de Ingreso: mayo-2002
Ubicación: Funkyland
Mensajes: 8.433
Antigüedad: 22 años
Puntos: 177
Re: como hacer un boton ocultar ( spoiler en html)

Código HTML

Código HTML:
<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&iacute;tulo para axpandir la informaci&oacute;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> 
Código Javascript:

Código HTML:
//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=OCULTO;
    }
  function ocultar1(blo) {
    document.getElementById(blo).style.display=OCULTO;
    document.getElementById('ver_off1').style.display=OCULTO;
    document.getElementById('ver_on1').style.display=VISIBLE;
    }
Espero te sirva
__________________
Desarrollos dosLotos
Calendario Maya, Meditación, Osho