Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if( !$tmp["IMAGENES_NOMBRE"] )
- {
- echo '<a name="'. $tmp["ID"]. '"></a>';
- echo '<div id="fastgalery">
- <div class="space">
- <div class="data">
- <div id="arrow_izq" class="arrow_'. $tmp["ID"]. '_0"></div>
- <div id="arrow_der" class="arrow_'. $tmp["ID"]. '_1"></div>
- </div>
- <div class="textarea">
- <h1>'. desproteger_cadena($tmp["TITULO"]). '</h1>
- hola contenido...
- </div>
- </div>';
- printallimage( $tmp["IMAGENES_URL"].$tmp["ID"], $tmp["ID"], $tmp["TITULO"], "medium" );
- echo '</div>';
- if( $cont_img>1 ) # si es mayor a 1, ponermos selector de imagenes
- {
- $c=0;
- $limite=6;
- echo '
- <div id="galeria-nav2"><div class="miniarrow_izq"></div>
- ';
- for( $i=0; $i<$cont_img; $i++ )
- {
- if( !($c%$limite) && !$i )
- echo '<div class="cleandiv">';
- else if( !($c%$limite) )
- echo '<div class="cleandiv" style="display:none;">';
- 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>';
- if( $c>0 && !(($c+1)%$limite) )
- echo '</div>';
- $c++;
- }
- if( $c%$limite )
- echo '</div>';
- echo '<div class="miniarrow_der"></div></div>
- ';
- unset($c);
- }
- echo '<script type="text/javascript">
- $(document).ready(function(){
- $.fn.hiddenshow = function () {
- if( $(this).is( \':hidden\' ) )
- $(this).fadeIn( "slow" );
- else
- $(this).fadeOut( "slow" );
- }
- });
- $(\'#botonizq\').click(function(evento) {
- alert(\'Capa Derecha tiene el elemento: \'+ $(\'#arrow_der\').attr("class") );
- return false;
- });
- ';
- for($i=0; $i<$cont_img; $i++ )
- {
- echo '
- $(\'.'. $tmp["ID"]. '_'. $i. '_clic\').hover( function(event) {
- ';
- # thumbnails mini images
- echo 'if( $(\'.'. $tmp["ID"]. '_'. $i. '\').is(\':hidden\') )
- {
- ';
- for($y=0; $y<$cont_img; $y++ )
- {
- if( $y==$i )
- {
- echo '$(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "block" );
- ';
- }
- else
- {
- echo '$(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "none" );
- ';
- }
- }
- echo '}
- });';
- }
- # arrows derecha
- echo '
- $(\'#arrow_der\').click( function(event) {';
- for($i=0; $i<$cont_img; $i++ )
- {
- if( !$i )
- {
- echo '
- if';
- }
- else
- {
- echo '
- else if';
- }
- echo '( $(\'#arrow_der\').hasClass("arrow_'. $tmp["ID"]. '_'. $i. '") )
- {
- $(\'#arrow_der\').removeClass( $(\'#arrow_izq\').attr( "class") );
- $(\'#arrow_izq\').removeClass( $(\'#arrow_izq\').attr( "class") );';
- if( ($i+1)==$cont_img )
- {
- echo '
- $(\'#arrow_der\').attr( "class", "arrow_'. $tmp["ID"]. '_'. $i. '" );
- $(\'#arrow_izq\').attr( "class", "arrow_'. $tmp["ID"]. '_'. ($i-1). '" );';
- }
- else
- {
- echo '
- $(\'#arrow_der\').attr( "class", "arrow_'. $tmp["ID"]. '_'. ($i+1). '" );
- $(\'#arrow_izq\').attr( "class", "arrow_'. $tmp["ID"]. '_'. $i. '" );';
- }
- for($y=0; $y<$cont_img; $y++ )
- {
- if( $y==$i )
- {
- echo '
- $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "block" );';
- }
- else
- {
- echo '
- $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "none" );';
- }
- }
- echo '
- }';
- }
- echo '
- });';
- # arrow izquierda
- echo '
- $(\'#arrow_izq\').click( function(event) {';
- for($i=0; $i<$cont_img; $i++ )
- {
- if( !$i )
- {
- echo '
- if';
- }
- else
- {
- echo '
- else if';
- }
- echo '( $(\'#arrow_izq\').hasClass("arrow_'. $tmp["ID"]. '_'. $i. '") )
- {
- $(\'#arrow_der\').removeClass( $(\'#arrow_der\').attr( "class") );
- $(\'#arrow_izq\').removeClass( $(\'#arrow_izq\').attr( "class") );';
- if( $i==0 ) # si es cero, se queda igual
- {
- echo '
- $(\'#arrow_izq\').addClass( "arrow_'. $tmp["ID"]. '_'. $i. '" );
- $(\'#arrow_der\').addClass( "arrow_'. $tmp["ID"]. '_'. ($i+1). '" );';
- }
- else # entonces cambiamos
- {
- echo '
- $(\'#arrow_izq\').addClass( "arrow_'. $tmp["ID"]. '_'. ($i-1). '" );
- $(\'#arrow_der\').addClass( "arrow_'. $tmp["ID"]. '_'. $i. '" );';
- }
- for($y=0; $y<$cont_img; $y++ )
- {
- if( $y==$i )
- {
- echo '
- $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "block" );';
- }
- else
- {
- echo '
- $(\'.'. $tmp["ID"]. '_'. $y. '\').css( "display", "none" );';
- }
- }
- echo '
- }';
- }
- echo '
- });';
- echo '
- </script>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement