
13/10/2008, 12:44
|
| | Fecha de Ingreso: octubre-2008
Mensajes: 25
Antigüedad: 16 años, 5 meses Puntos: 0 | |
Respuesta: Como cambiar el src de una imagen dinamicamente este codigo funciona perfecto en ie6 pero en ie7 solo funciona una ves aunque el setinterval se ejecuta normalmente no me cambia el src de la imagen
te agrdezco muchisimo tu ayuda y recomendaciones pues la verdad soy novato con javascript
aca te coloco el codigo:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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 id="Head1" runat="server">
<title>Página sin título</title>
</head>
<script type="text/javascript">
function start(){
foto1 = new Image();
foto2 = new Image();
foto3 = new Image();
url = "http://xxx";
foto1.src = url + "?num="+num();
document.images("Img1").src = foto1.src;
url2 = "http://xxx";
foto2.src= url2 +"?num1="+num();
document.images("imagen").src= foto2.src;
url3 = "http://xxx";
foto3.src= url3 +"?num1="+num();
document.images("Img2").src= foto3.src;
}
function num() {
var aleatorio
return aleatorio = Math.round(Math.random()*1000);
}
</script>
<body onload= "setInterval('start()',2000);" >
<form id="form1" runat="server">
<div>
<img id="imagen" alt = "2" src="" style="z-index: 106; left: 664px; width: 280px; position: absolute; top: 64px;
height: 216px"/>
<img id="Img1" src=""style="z-index: 107; left: 336px; width: 280px; position: absolute; top: 64px;
height: 216px" alt = "1" />
<img src="" id="Img2" style="z-index: 108; left: 0px; width: 280px; position: absolute; top: 64px;
height: 216px" />
</div>
</form>
</body>
</html> |