Ver Mensaje Individual
  #6 (permalink)  
Antiguo 08/03/2013, 12:25
mbonda
 
Fecha de Ingreso: octubre-2011
Ubicación: Argentina
Mensajes: 9
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: Problemas con PHP y javascript

Cita:
Iniciado por walterdevel Ver Mensaje
Tenes alguna url donde se pueda ver? Lo que ayudaria es que postees el codigo que genera tu pagina php.
Acá va la página donde se llama al carrusel y se envían las variables:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="carrusel/css/elastislide.css" />
<link rel="stylesheet" type="text/css" href="carrusel/css/custom.css" />
<script src="js/modernizr.custom.17475.js"></script>
</head>

<body>
<div class="container demo-3">
<!-- Carrusel -->
<ul id="carousel" class="elastislide-list">
<?php
$sql = "Select * from productos where Estado='0' and Genero!='Caballero' ORDER BY idProducto DESC";
$rs = mysql_query($sql,$cnConex);
$tmax = mysql_num_rows($rs);
for ($i=0;$i<$tmax;$i++)
{
include "db.php";
?>
<!-- Comienza el Carrusel -->
<li>
<a rel="lightbox[galerie]">
<img src="<?php echo $xx0;?>" onclick="espacio<?php echo $i;?>();txt<?php echo $i;?>();detalle<?php echo $i;?>();relacionada<?php echo $i;?>();escribe<?php echo $i;?>()" />
</a>
</li>
<!-- Finaliza el Carrusel -->

<!-- Comienza función para abrir imágenes en "div" -->
<script type="text/javascript">
<!-- Función abre imagen grande -->
function espacio<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<img src='<?php echo $xx0;?>' width='700' height='480'/>";
}
<!-- Función abre data (txt) de la imagen -->
function txt<?php echo $i;?>() {
document.getElementById('titulo_1').innerHTML = "<?php if($Articulo!==""):?><?php echo $Articulo;?><?php endif;?><?php if($Nombre!==""):?> | <?php echo $Nombre;?><?php endif;?>";
document.getElementById('titulo_2').innerHTML = "<?php if($Numeracion_1!==""):?>Disponible del número <?php echo $Numeracion_1;?> al <?php echo $Numeracion_2;?><?php endif;?><?php if($Detalle!==""):?> | <?php echo $Detalle;?><?php endif;?>";
}
<!-- Función abre imágenes de detalle -->
function detalle<?php echo $i;?>() {
document.getElementById('zapato').innerHTML = "<?php if($Foto1!==""):?><img src='<?php echo $xx1;?>' width='117' width='80' onclick='zapato_up<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('rz').innerHTML = "<?php if($Foto1!==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle1').innerHTML = "<?php if($Foto2!==""):?><img src='<?php echo $xx2;?>' width='117' width='80' onclick='detalle1_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r1').innerHTML = "<?php if($Foto2!==""&$Foto1==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle2').innerHTML = "<?php if($Foto3!==""):?><img src='<?php echo $xx3;?>' width='117' width='80' onclick='detalle2_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r2').innerHTML = "<?php if($Foto3!==""&$Foto1!==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle3').innerHTML = "<?php if($Foto4!==""):?><img src='<?php echo $xx4;?>' width='117' width='80' onclick='detalle3_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r3').innerHTML = "<?php if($Foto4!==""&$Foto1==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle4').innerHTML = "<?php if($Foto5!==""):?><img src='<?php echo $xx5;?>' width='117' width='80' onclick='detalle4_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r4').innerHTML = "<?php if($Foto5!==""&$Foto1!==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle5').innerHTML = "<?php if($Foto6!==""):?><img src='<?php echo $xx6;?>' width='117' width='80' onclick='detalle5_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r5').innerHTML = "<?php if($Foto6!==""&$Foto1==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle6').innerHTML = "<?php if($Foto7!==""):?><img src='<?php echo $xx7;?>' width='117' width='80' onclick='detalle6_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r6').innerHTML = "<?php if($Foto7!==""&$Foto1!==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle7').innerHTML = "<?php if($Foto8!==""):?><img src='<?php echo $xx8;?>' width='117' width='80' onclick='detalle7_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r7').innerHTML = "<?php if($Foto8!==""&$Foto1==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle8').innerHTML = "<?php if($Foto9!==""):?><img src='<?php echo $xx9;?>' width='117' width='80' onclick='detalle8_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
document.getElementById('r8').innerHTML = "<?php if($Foto9!==""&$Foto1!==""):?><img src='imagenes/relleno.png' width='8' width='80'/><?php endif;?>";
document.getElementById('detalle9').innerHTML = "<?php if($Foto10!==""):?><img src='<?php echo $xx10;?>' width='117' width='80' onclick='detalle9_<?php echo $i;?>()' style='cursor:pointer'/><?php endif;?>";
}
<!-- Función abre imagenes de detalle en la grande -->
function zapato_up<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto1!==""):?><img src='<?php echo $xx1;?>' width='700' height='480'/><?php endif;?>";
}
function detalle1_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto2!==""):?><img src='<?php echo $xx2;?>' width='700' height='480'/><?php endif;?>";
}
function detalle2_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto3!==""):?><img src='<?php echo $xx3;?>' width='700' height='480'/><?php endif;?>";
}
function detalle3_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto4!==""):?><img src='<?php echo $xx4;?>' width='700' height='480'/><?php endif;?>";
}
function detalle4_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto5!==""):?><img src='<?php echo $xx5;?>' width='700' height='480'/><?php endif;?>";
}
function detalle5_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto6!==""):?><img src='<?php echo $xx6;?>' width='700' height='480'/><?php endif;?>";
}
function detalle6_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto7!==""):?><img src='<?php echo $xx7;?>' width='700' height='480'/><?php endif;?>";
}
function detalle7_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto8!==""):?><img src='<?php echo $xx8;?>' width='700' height='480'/><?php endif;?>";
}
function detalle8_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto9!==""):?><img src='<?php echo $xx9;?>' width='700' height='480'/><?php endif;?>";
}
function detalle9_<?php echo $i;?>() {
document.getElementById('espacio_fondo').innerHTML = "<?php if($Foto10!==""):?><img src='<?php echo $xx10;?>' width='700' height='480'/><?php endif;?>";
}
<!-- Función abre galería relacionada -->
function relacionada<?php echo $i;?>() {
document.getElementById('espacio_relacionadas').in nerHTML = "<?php if($Foto11!==""):?>Ver GALERIA RELACIONADA<?php endif;?>";
}

function escribe<?php echo $i;?>() {
document.getElementById('pepe').innerHTML = "<?php echo $idProducto;?>";
}
</script>
<!-- Finaliza función para abrir imágenes en "div" -->

<script>
var variablejs = "<p id='pepe'></p>" ;
</script>

<?php }?>

</ul>
<!-- End Carrusel -->
</div>
<script type="text/javascript" src="js/1.8.2_jquery.min.js"></script>
<script type="text/javascript" src="js/jquerypp.custom.js"></script>
<script type="text/javascript" src="js/jquery.elastislide.js"></script>
<script type="text/javascript">
$( '#carousel' ).elastislide( {
minItems : 2
} );
</script>
</body>
</html>

Sigue más abajo...