Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/05/2011, 16:12
Avatar de ArturoGallegos
ArturoGallegos
Moderador
 
Fecha de Ingreso: febrero-2008
Ubicación: Morelia, México
Mensajes: 6.774
Antigüedad: 16 años, 2 meses
Puntos: 1146
Respuesta: Mostrar/Ocultar Divs

creo que buscas algo así...

Código HTML:
Ver original
  1. <script type="text/javascript">
  2.     function MostrarContenido(id){
  3.        var Contenido = document.getElementById(id);
  4.        if(Contenido.style.display == 'none'){
  5.         Contenido.style.display = '';
  6.        }
  7.        else{
  8.         Contenido.style.display = 'none';
  9.        }
  10.     }
  11.  
  12. <ul>
  13.     <li onclick="MostrarContenido('Cont1');">Contenido 1</li>
  14.     <li onclick="MostrarContenido('Cont2');">Contenido 2</li>
  15.     <li onclick="MostrarContenido('Cont3');">Contenido 3</li>
  16. </ul>
  17.  
  18. <div id="Cont1" style="display:none;"><h2>Cont 1</h2>
  19. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
  20. </div>
  21. <div id="Cont2" style="display:none;"><h2>Cont 2</h2>
  22. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
  23. </div>
  24. <div id="Cont3" style="display:none;"><h2>Cont 3</h2>
  25. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
  26. </div>

prueba haber si te sirve

Nota: las ID no deben de repetirse dentro del mismo HTML, por como veo tu html estas repitiendo la id mostrarDiv y flotante

Última edición por ArturoGallegos; 16/05/2011 a las 16:20