Foros del Web » Programando para Internet » PHP »

Problema slider

Estas en el tema de Problema slider en el foro de PHP en Foros del Web. hola amigos, tengo un problema con un slider que estoy haciendo, el problema es el siguiente: Código PHP: <div id="featured" >           <ul class="ui-tabs-nav">            <?php                                                                              $SQL = ...
  #1 (permalink)  
Antiguo 06/05/2010, 11:18
 
Fecha de Ingreso: enero-2009
Mensajes: 142
Antigüedad: 15 años, 2 meses
Puntos: 0
Pregunta Problema slider

hola amigos, tengo un problema con un slider que estoy haciendo, el problema es el siguiente:

Código PHP:
<div id="featured" >
          <ul class="ui-tabs-nav">
          <?php
                                    
                                        $SQL
=SqlNoticia();
                                         
$SQL .=" and DestacHome=1";
                                        
$SQL .=" group by CodNotic,TitNotic,ResumnNotic,FecNotic order by FecNotic Desc Limit 5";
                                        
                                        
$SQL=SQLSeguro($SQL);
                                        
$Datos mysql_query($SQL);
                                        if (
$Datos) {
                                            
$num=mysql_num_rows($Datos);                    
                                            
$i=0;        
                                            while (
$i $num) {
                                                include(
"datosnoticia.php");                                        
                                                
$Altura=70;//$Altura=140; OJO PARA subir y bajar las flechas
                                            
?>
            <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1"><img src="<?php echo $RutaFotos?>/1.jpg" alt="" width="80" height="50" /><span><?php echo $TitNotic?></span></a></li>
            <?php                
                                            
++$i;
                                            } 
//do while
                                        
}//if Datos
                                     
?>
            
          </ul>
           <?php
                                    
                                        $SQL
=SqlNoticia();
                                         
$SQL .=" and DestacHome=1";
                                        
$SQL .=" group by CodNotic,TitNotic,ResumnNotic,FecNotic order by FecNotic Desc Limit 5";
                                        
                                        
$SQL=SQLSeguro($SQL);
                                        
$Datos mysql_query($SQL);
                                        if (
$Datos) {
                                            
$num=mysql_num_rows($Datos);                    
                                            
$i=0;        
                                            while (
$i $num) {
                                                include(
"datosnoticia.php");                                        
                                                
$Altura=70;
                                            
?>

        <!-- First Content -->
        <div id="fragment-1" class="ui-tabs-panel" style="">
            <img src="<?php echo $RutaFotos?>/1.jpg" alt="" width="400" height="250" />
             <div class="info" >
           <h2><a target="_parent" title="<?php echo $TitNotic?>" href="detnotic.php?CodNotic=<?php echo $CodNotic ?>"><?php echo $TitNotic?></a></h2>
                <p><?php echo $ResumnNotic?></p>
             </div>
        </div>   
<?php                
                                            
++$i;
                                            } 
//do while
                                        
}//if Datos
                                     
?>
</div>
mi problema ocurre en esta en el id como puedo hacer para que a medida que aumenten las consultas me vaya cambiando el n° del id.

<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1">

<div id="fragment-1" class="ui-tabs-panel" style="">

desde ya gracias por sus respuestas.
  #2 (permalink)  
Antiguo 06/05/2010, 13:38
Avatar de Nekeniehl  
Fecha de Ingreso: julio-2009
Ubicación: Berlin, Alemania / Granada, España
Mensajes: 132
Antigüedad: 14 años, 9 meses
Puntos: 6
Respuesta: Problema slider

Si pones una variable $cont por ejemplo que aumente con el bucle antes de cada id?

Código PHP:
Ver original
  1. while ($i < $num) {
  2.                                                 include("datosnoticia.php");                                        
  3.                                                 $Altura=70;//$Altura=140; OJO PARA subir y bajar las flechas
  4.                                             $cont++?>
  5.             <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-"<?php echo $cont?>><a href="#fragment-"<?php echo $cont ?>><img src="<?php echo $RutaFotos?>/1.jpg" alt="" width="80" height="50" /><span><?php echo $TitNotic?></span></a></li>
  6.             <?php                
  7.                                             ++$i;
  8.                                             } //do while

Etiquetas: slider
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:59.