Ver Mensaje Individual
  #7 (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.
Y esta página reciba las mismas y prepara el lightbox:

<!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="lightbox_relacionadas/fancy.css" media="screen" />
<script type="text/javascript" src="lightbox_relacionadas/jquery-1.2.3.pack.js"></script>
<!-- Aplico función NO CONFLICT en la llamada a la versión de jquerry que carga primero, más allá de que sea más vieja o más nueva que las demás, y se declara una variable "x", en este caso "$jq123" que reemplaza a lo que antes era "$" -->
<!-- Inicio -->
<script type='text/javascript'>
var $jq123 = jQuery.noConflict();
</script>
<!-- Fin -->
<script type="text/javascript" src="lightbox_relacionadas/jquery.fancybox-1.0.0.js"></script>

</head>

<body>
<?php
$variablephp = "<script> document.write(variablejs) </script>";
echo "$variablephp";
?>
<?php if($reg['Foto11']!==""):?>
<!-- Lighbox Imágenes Relacionadas M237 -->
<script type="text/javascript">
$jq123(document).ready(function() {
$jq123("a#relacionadas").fancybox({
'itemLoadCallback':getGroupItems,
'overlayShow':true
});
});
var imageList = [
<?php
$registros=mysql_query("select * from productos where Estado='0' and idProducto='' and Genero!='Caballero' ORDER BY idProducto DESC" ,$cnConex) or
die("Problemas en el select:".mysql_error());
if ($reg=mysql_fetch_array($registros))
{
?>
<?php include "lightbox_relacionadas/variables.php";?>
<?php }?>
];
function getGroupItems(opts) {
jQuery.each(imageList, function(i, val) {
opts.itemArray.push(val);
});
}
</script>
<?php endif;?>

<?php
$registros=mysql_query("select * from productos where Estado='0' and Genero!='Caballero' ORDER BY idProducto DESC LIMIT 0,1",$cnConex) or
die("Problemas en el select:".mysql_error());
if ($reg=mysql_fetch_array($registros))
{
?>

<div id="espacio_galerias2">

<!-- Detalles -->
<div id="espacio_miniaturas_detalles">
<div id="zapato"><?php if($reg['Foto1']!==""):?>
<img src="Fotos/<?php echo $reg['Foto1']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='zapato_upX()'/>
<?php endif;?>
</div>
<div id="rz"></div>
<div id="detalle1"><?php if($reg['Foto2']!==""):?>
<img src="Fotos/<?php echo $reg['Foto2']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle1X()'/>
<?php endif;?>
</div>
<div id="r1"></div>
<div id="detalle2"><?php if($reg['Foto3']!==""):?>
<img src="Fotos/<?php echo $reg['Foto3']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle2X()'/>
<?php endif;?>
</div>
<div id="r2"></div>
<div id="detalle3"><?php if($reg['Foto4']!==""):?>
<img src="Fotos/<?php echo $reg['Foto4']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle3X()'/>
<?php endif;?>
</div>
<div id="r3"></div>
<div id="detalle4"><?php if($reg['Foto5']!==""):?>
<img src="Fotos/<?php echo $reg['Foto5']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle4X()'/>
<?php endif;?>
</div>
<div id="r4"></div>
<div id="detalle5"><?php if($reg['Foto6']!==""):?>
<img src="Fotos/<?php echo $reg['Foto6']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle5X()'/>
<?php endif;?>
</div>
<div id="r5"></div>
<div id="detalle6"><?php if($reg['Foto7']!==""):?>
<img src="Fotos/<?php echo $reg['Foto7']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle6X()'/>
<?php endif;?>
</div>
<div id="r6"></div>
<div id="detalle7"><?php if($reg['Foto8']!==""):?>
<img src="Fotos/<?php echo $reg['Foto8']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle7X()'/>
<?php endif;?>
</div>
<div id="r7"></div>
<div id="detalle8"><?php if($reg['Foto9']!==""):?>
<img src="Fotos/<?php echo $reg['Foto9']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle8X()'/>
<?php endif;?>
</div>
<div id="r8"></div>
<div id="detalle9"><?php if($reg['Foto10']!==""):?>
<img src="Fotos/<?php echo $reg['Foto10']; ?>" style="width:117px; height:80px; cursor:pointer;" border="0" onclick='detalle9X()'/>
<?php endif;?>
</div>
</div>

<!-- Galerías Relacionas -->
<a id="relacionadas" style="cursor:pointer; border:0"><?php if($reg['Foto11']!==""):?>
<div id="espacio_relacionadas">Ver GALERIA RELACIONADA</div>
<?php endif;?></a>

</div>

<!-- Función abre imagenes de detalle en la grande -->
<script type="text/javascript">
function zapato_upX() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto1'];?>' width='700' height='480'/>";
}
function detalle1X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto2'];?>' width='700' height='480'/>";
}
function detalle2X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto3'];?>' width='700' height='480'/>";
}
function detalle3X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto4'];?>' width='700' height='480'/>";
}
function detalle4X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto5'];?>' width='700' height='480'/>";
}
function detalle5X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto6'];?>' width='700' height='480'/>";
}
function detalle6X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto7'];?>' width='700' height='480'/>";
}
function detalle7X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto8'];?>' width='700' height='480'/>";
}
function detalle8X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto9'];?>' width='700' height='480'/>";
}
function detalle9X() {
document.getElementById('espacio_fondo').innerHTML = "<img src='Fotos/<?php echo $reg['Foto10'];?>' width='700' height='480'/>";
}
</script>

<?php }?>

</body>
</html>

Espero que no sea más engorroso...