Advertisement
diabliyo

galeria_roll_ouw_jquery

Feb 7th, 2012
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.53 KB | None | 0 0
  1. <?php
  2.                 if( !$tmp["IMAGENES_NOMBRE"] )
  3.                     {
  4.                     echo '<a name="'. $tmp["ID"]. '"></a>';
  5.                     echo '<div id="fastgalery">
  6.                     <div class="space">
  7.                         <div class="data">
  8.                             <div id="arrow_izq" class="arrow_'. $tmp["ID"]. '_0"></div>
  9.                             <div id="arrow_der" class="arrow_'. $tmp["ID"]. '_1"></div>
  10.                         </div>
  11.                         <div class="textarea">
  12.                         <h1>'. desproteger_cadena($tmp["TITULO"]). '</h1>
  13.                         hola contenido...
  14.                         </div>
  15.                     </div>';
  16.                     printallimage( $tmp["IMAGENES_URL"].$tmp["ID"], $tmp["ID"], $tmp["TITULO"], "medium" );
  17.                     echo '</div>';
  18.                     if( $cont_img>1 ) # si es mayor a 1, ponermos selector de imagenes
  19.                         {
  20.                         $c=0;
  21.                         $limite=6;
  22.                         echo '
  23.                         <div id="galeria-nav2"><div class="miniarrow_izq"></div>
  24.                                
  25.                         ';
  26.                         for( $i=0; $i<$cont_img; $i++ )
  27.                             {
  28.                             if( !($c%$limite) && !$i )
  29.                                 echo '<div class="cleandiv">';
  30.                             else if( !($c%$limite) )
  31.                                 echo '<div class="cleandiv" style="display:none;">';
  32.                                
  33.                             echo '<div class="in '. $tmp["ID"]. '_'. $i. '_clic"><a href="#'. $tmp["ID"]. '">'. printallimage_number( $tmp["IMAGENES_URL"].$tmp["ID"], $tmp["ID"], $tmp["TITULO"], "medium", $i, array( "html", "_mini") ). '</a></div>';
  34.                             if( $c>0 && !(($c+1)%$limite) )
  35.                                 echo '</div>';
  36.                             $c++;
  37.                             }
  38.                              
  39.                         if( $c%$limite )
  40.                             echo '</div>';
  41.                         echo '<div class="miniarrow_der"></div></div>
  42.                         ';
  43.                         unset($c);
  44.                         }
  45.                        
  46.                     echo '<script type="text/javascript">
  47.                     $(document).ready(function(){
  48.                     $.fn.hiddenshow = function () {
  49.                         if( $(this).is( \':hidden\' ) )
  50.                             $(this).fadeIn( "slow" );
  51.                         else
  52.                             $(this).fadeOut( "slow" );
  53.                         }
  54.                     });
  55.                    
  56.                     $(\'#botonizq\').click(function(evento) {
  57.                         alert(\'Capa Derecha tiene el elemento: \'+ $(\'#arrow_der\').attr("class") );
  58.                     return false;
  59.                     });
  60.                     ';
  61.                    
  62.                     for($i=0; $i<$cont_img; $i++ )
  63.                         {
  64.                         echo '
  65.                         $(\'.'. $tmp["ID"]. '_'. $i. '_clic\').hover( function(event) {
  66.                         ';
  67.                         # thumbnails mini images
  68.                         echo 'if( $(\'.'. $tmp["ID"]. '_'. $i. '\').is(\':hidden\') )
  69.                                     {
  70.                                     ';
  71.                                     for($y=0; $y<$cont_img; $y++ )
  72.                                         {
  73.                                         if( $y==$i )
  74.                                             {
  75.                                             echo '$(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "block" );
  76.                                     ';
  77.                                             }
  78.                                         else
  79.                                             {
  80.                                             echo '$(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "none" );
  81.                                     ';
  82.                                             }
  83.                                         }
  84.                                     echo '}
  85.                                 });';
  86.                             }
  87.                        
  88.                         # arrows derecha
  89.                         echo '
  90.                         $(\'#arrow_der\').click( function(event) {';
  91.                             for($i=0; $i<$cont_img; $i++ )
  92.                                         {
  93.                                     if( !$i )
  94.                                         {
  95.                                     echo '
  96.                                     if';
  97.                                         }
  98.                                     else
  99.                                         {
  100.                                         echo '
  101.                                         else if';
  102.                                         }
  103.                                     echo '( $(\'#arrow_der\').hasClass("arrow_'. $tmp["ID"]. '_'. $i. '") )
  104.                                             {
  105.                                             $(\'#arrow_der\').removeClass( $(\'#arrow_izq\').attr( "class") );
  106.                                             $(\'#arrow_izq\').removeClass( $(\'#arrow_izq\').attr( "class") );';
  107.                                             if( ($i+1)==$cont_img )
  108.                                                 {
  109.                                                 echo '
  110.                                             $(\'#arrow_der\').attr( "class", "arrow_'. $tmp["ID"]. '_'. $i. '" );
  111.                                             $(\'#arrow_izq\').attr( "class", "arrow_'. $tmp["ID"]. '_'. ($i-1). '" );';
  112.                                                 }
  113.                                             else
  114.                                                 {
  115.                                                 echo '
  116.                                             $(\'#arrow_der\').attr( "class", "arrow_'. $tmp["ID"]. '_'. ($i+1). '" );
  117.                                             $(\'#arrow_izq\').attr( "class", "arrow_'. $tmp["ID"]. '_'. $i. '" );';
  118.                                                 }
  119.  
  120.                                     for($y=0; $y<$cont_img; $y++ )
  121.                                         {
  122.                                         if( $y==$i )
  123.                                             {
  124.                                             echo '
  125.                                     $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "block" );';
  126.                                             }
  127.                                         else
  128.                                             {
  129.                                             echo '
  130.                                     $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "none" );';
  131.                                             }
  132.                                         }
  133.                                            
  134.                                             echo '
  135.                                             }';
  136.                                         }
  137.                                     echo '
  138.                                 });';
  139.  
  140.                         # arrow izquierda
  141.                         echo '
  142.                         $(\'#arrow_izq\').click( function(event) {';
  143.                             for($i=0; $i<$cont_img; $i++ )
  144.                                         {
  145.                                     if( !$i )
  146.                                         {
  147.                                     echo '
  148.                                     if';
  149.                                         }
  150.                                     else
  151.                                         {
  152.                                         echo '
  153.                                         else if';
  154.                                         }
  155.                                     echo '( $(\'#arrow_izq\').hasClass("arrow_'. $tmp["ID"]. '_'. $i. '") )
  156.                                             {
  157.                                             $(\'#arrow_der\').removeClass( $(\'#arrow_der\').attr( "class") );
  158.                                             $(\'#arrow_izq\').removeClass( $(\'#arrow_izq\').attr( "class") );';
  159.                                             if( $i==0 ) # si es cero, se queda igual
  160.                                                 {
  161.                                                 echo '
  162.                                             $(\'#arrow_izq\').addClass( "arrow_'. $tmp["ID"]. '_'. $i. '" );
  163.                                             $(\'#arrow_der\').addClass( "arrow_'. $tmp["ID"]. '_'. ($i+1). '" );';
  164.                                                 }
  165.                                             else # entonces cambiamos
  166.                                                 {
  167.                                                 echo '
  168.                                             $(\'#arrow_izq\').addClass( "arrow_'. $tmp["ID"]. '_'. ($i-1). '" );
  169.                                             $(\'#arrow_der\').addClass( "arrow_'. $tmp["ID"]. '_'. $i. '" );';
  170.                                                 }
  171.  
  172.                                     for($y=0; $y<$cont_img; $y++ )
  173.                                         {
  174.                                         if( $y==$i )
  175.                                             {
  176.                                             echo '
  177.                                     $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "block" );';
  178.                                             }
  179.                                         else
  180.                                             {
  181.                                             echo '
  182.                                     $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "none" );';
  183.                                             }
  184.                                         }
  185.                                            
  186.                                             echo '
  187.                                             }';
  188.                                         }
  189.                                     echo '
  190.                                 });';
  191.  
  192.                     echo '
  193.                     </script>';
  194.                     }
  195. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement