Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/04/2014, 10:03
Avatar de ceaped
ceaped
 
Fecha de Ingreso: febrero-2004
Mensajes: 2.185
Antigüedad: 20 años, 2 meses
Puntos: 9
Pregunta Contador de pestañas de un acordeón

Buenos días
Tengo un sistema de acordeón así:

1. Una página index.php
2. En ella se cargan otras páginas cada una en una pestaña.

Código PHP:
Ver original
  1. <?php include("pagina_01.html"); ?>

Como le puedo poner un contador para saber cuantas pestañas hay ya sea si se aumenta o se quita

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <title>Título</title>
  4.  
  5. <script type="text/javascript" src="js/jquery.min.js"> </script>
  6.  
  7.  
  8. <!-- acordeon -->
  9. <script type="text/javascript">
  10. $(document).ready(function() {
  11.      
  12.     jQuery('.bloque_activador_rojo').click(function() {
  13.         jQuery('.bloque_activador_rojo').removeClass('on');      
  14.         jQuery('.accordionContent').slideUp('normal');  
  15.         if(jQuery(this).next().is(':hidden') == true) {        
  16.             jQuery(this).addClass('on');             
  17.             jQuery(this).next().slideDown('normal');
  18.          }
  19.          
  20.      });
  21.    
  22.     jQuery('.accordionContent').mouseover(function() {
  23.         jQuery(this).addClass('over');
  24.        
  25.     }).mouseout(function() {
  26.         jQuery(this).removeClass('over');                                      
  27.     });
  28.        
  29.     jQuery('.accordionContent').hide();
  30.  
  31. });
  32. <!-- acordeon -->
  33.  
  34. </head>
  35.  
  36.  
  37. <div id="container">
  38.  
  39. <h2 class="bloque_activador_rojo" title="Haz clic">Pestaña 1</h2>
  40. <div class="accordionContent">
  41.  
  42. <?php include("pagina_01.html"); ?></div>
  43.  
  44.  
  45. <h2 class="bloque_activador_rojo" title="Haz clic">Pestaña 2</h2>
  46. <div class="accordionContent">
  47.  
  48. <?php include("pagina_02.html"); ?></div>
  49.  
  50.  
  51. <h2 class="bloque_activador_rojo" title="Haz clic">Pestaña 3</h2>
  52. <div class="accordionContent">
  53.  
  54. <?php include("pagina_03.html"); ?></div>
  55.  
  56.  
  57. <div class="footer">Footer</div>
  58.  
  59. </div>
  60.  
  61. </body>
  62. </html>

Gracias por su ayuda
__________________
Diseñador Gráfico publicitario