Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/05/2007, 03:21
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Re: Textos desplegables???

Hola eeyore

Prueba este ejemplo:

Código PHP:
<html>
<
style type="text/css">
.
oculto {display:none}
</
style>
<
script type="text/javascript">
var 
visto null;
function 
ver(num) {
  
obj document.getElementById(num);
  
obj.style.display = (obj==visto) ? 'none' 'block';
  if (
visto != null)
    
visto.style.display 'none';
  
visto = (obj==visto) ? null obj;
}
</script>
<head>
</head>
<body>
<p onclick="ver('uno')">Título 1</p>
<p class="oculto" id="uno">Texto uno</p>
<p onclick="ver('dos')">Título 2</p>
<p class="oculto" id="dos">Texto dos</p>
</body>
</html> 
Saludos,