Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/05/2005, 17:04
jadi
 
Fecha de Ingreso: junio-2004
Mensajes: 158
Antigüedad: 20 años, 7 meses
Puntos: 1
cambiar una imagen al hacer click - ayudaaa

hola gente este es un tema ya largamente debatido pero les cuento el problema a ver si los grandes pueden ver el error yo no lo encuentro

tengo tres imagenes que al hacer click en cada una tienen que cambiar por otra.
les cuento el script con mozilla anda fenomeno
pero con ie solo anda para la primera
socorrroooooo

el script:
<?
include("lib_carrito.php");
?>

<html>
<head>

<title>carrito de compras</title>

<style>
.shakeimage{
position:relative
}
</style>

<SCRIPT LANGUAGE="JavaScript">
var imagen1=new Image;
imagen1.src="http://www.web.com/images/carrito_lleno.gif";

function cambiarimg(ident) {
document.getElementById(ident).src=imagen1.src;
}

function ventanaSecundaria (URL){
window.open(URL,"ventanita","scrollbars=NO, resizable=NO, width=250, height=150, top=150, left=350")
}

// -->

</script>

</head>

<body>

<p><a href="javascript:ventanaSecundaria('mete_producto. php?id=12&nombre=silla+modelo+jupiter&precio=80')" >
<img border="0" src="images/carrito.gif" alt="Agregar el producto al carrito de compras" id="im1" onclick="cambiarimg(this.id)"></a></p>

<a href=" javascript:ventanaSecundaria('mete_producto.php?id =12&nombre=silla+modelo+jupiter&precio=80')">
<img border="0" src="images/carrito.gif" alt="Agregar el producto al carrito de compras" id="im2" onclick="cambiarimg(this.id)"></a>
<br>
<br>
<a href=" javascript:ventanaSecundaria('mete_producto.php?id =16&nombre=mesa+camilla+oferta&precio=29')">
<img border="0" src="images/carrito.gif" alt="Agregar el producto al carrito de compras" id="im3" onclick="cambiarimg(this.id)"></a>
<br>
<br>
<a href=" javascript:ventanaSecundaria('mete_producto.php?id =18&nombre=Silla+oficina&precio=102')">Silla oficina 102 euros</a>
<br>
<br>
<a href=" javascript:ventanaSecundaria('mete_producto.php?id =98&nombre=Aparador+cocina+blanco&precio=200')">Ap arador cocina blanco 200 euros</a>
<br>
<br>
<br>
- <a href="ver_carrito.php">Ver carrito</a>
</body>
</html>

mete_producto.php
<?
// No almacenar en el cache del navegador esta página.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Expira en fecha pasada
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Siempre página modificada
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0

include("lib_carrito.php");

$_SESSION["ocarrito"]->introduce_producto($_GET["id"], $_GET["nombre"], $_GET["precio"]);

?>
<html>
<head>
<title>gsistema - agregando articulos al carrito</title>


<SCRIPT LANGUAGE="JavaScript">
function cerrarV(){
setTimeout("window.close();",3000);
}

// End -->
</script>

</head>

<body onLoad="cerrarV()">

<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="235" height="83" id="AutoNumber1">
<tr>
<td width="106" height="42" rowspan="3">
<p align="center">
<img border="0" src="images/carrito_grande.gif" width="106" height="89"></td>
<td width="129" height="28" align="center"><b>
<font face="Tahoma" color="#0066CC">Haz Ingresado</font></b></td>
</tr>
<tr>
<td width="129" height="28" align="center"><b>
<font face="Tahoma" color="#0066CC">un Articulo</font></b></td>
</tr>
<tr>
<td width="129" height="33" align="center"><b>
<font face="Tahoma" color="#0066CC">al Carrito!!!</font></b></td>
</tr>
<tr>
<td width="235" height="15" colspan="2">
<p align="center">
<input type="button"
value="Cerrar esta ventana"
onclick="window.close();">
</td>
</tr>
</table>
</div>

</body>

</html>