Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/06/2012, 13:53
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Preguntas Frecuentes Desplegables

Algo como esto

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>mostrar oculta capas</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <style type="text/css">
  7. /*<![CDATA[*/
  8. p{
  9. font-weight: bold;
  10. cursor: pointer;
  11. }
  12. #Uno,#Dos,#Tres{
  13. display: none;
  14. }
  15. /*]]>*/
  16. <script type="text/javascript">
  17. //<![CDATA[
  18. function contenido(cual){
  19. var capas = new Array("Uno", "Dos", "Tres");
  20. var i;
  21.     for(i in capas){
  22.         if(capas[i] == cual){
  23.         document.getElementById(capas[i]).style.display = 'block';
  24.         }else{
  25.         document.getElementById(capas[i]).style.display = 'none';
  26.         }
  27.     }
  28. }
  29. //]]>
  30. </head>
  31. <p onclick="contenido('Uno')" >uno</p>
  32. <div id="Uno">Texto uno</div>
  33. <p onclick="contenido('Dos')" >dos</p>
  34. <div id="Dos">Texto dos</div>
  35. <p onclick="contenido('Tres')" >tres</p>
  36. <div id="Tres">Texto tres</div>
  37. </body>
  38. </html>
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.