
problemas con efecto de transicion
Publicado por jose maria (27 intervenciones) el 25/09/2014 20:52:27
hola, buscando por ay, encontre un codigo para hacer una transicion de imagenes, ahora resulta que no me funciona, ¿algien podria decirme por que?
gracias
codigo html (index)
codido javascript (javascript)
gracias
gracias
codigo html (index)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<title>
</title>
</head>
<body color ="#FFFFFF">
<table width="82%" border="0" align="center">
<tr>
<td width="30%" align="right" height="247">
<font color="#0033CC">
<b>
<a href="javascript:cambio(-1)">
atras
</a>
</b>
</font>
</td>
<td align="center" width="48%" height="247">
<img id="centro" src="1.jpg" height="170">
</td>
<td width="22%" height="247">
<font color="#0033CC">
<b>
<a href="javascript:cambio(1)">
avance
</a>
</b>
</font>
</td>
</tr>
<tr>
<td width="30%" align="right">
<font color="#0033CC">
</font>
</td>
<td width="48%" align="center">
<b>
<font color="#0033CC">
Automatico
</font>
</b>
<form name="form1" method="post" action="javascritp:automat(this.form1.tiempo.value)">
<input type="text" name="tiempo">
<br>
<input type="submit" name="Button" value="Inicio">
<input type="button" name="Button2" value="Parar" onclick="parar()">
</form>
</td>
<td width="22%"><font color="#0033CC">
</font>
</td>
</tr>
</table>
</body>
</html>
codido javascript (javascript)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var lista = new Array('1.jpg', '2.jpg', '3.jpg' , '4.jpg');
var contador = 0;
var tiempo = 0;
var tempor = null;
function cambio(sen)
{
contador+= sen;
if (contador ==lista.length)
contador = lista.length-1;
else
if (contador < 0) contador = 0;
document.images.centro.src = lista[contador]
window.status="Imagen número "+contador
}
function reset()
{
contador = 0;
fin = false;
document.images.centro.src = lista[0]
}
function automat(seg)
{
tiempo = parseInt(seg);
reset();
window.status="Pase automático";
if (isNaN(tiempo) || tiempo <= 0)
alert("Error en el tiempo")
else
tempor = setTimeout("pasar()", tiempo)
}
function parar()
{
clearTimeout(tempor);
}
function pasar()
{
cambio(1);
if (contador < lista.length-1)
tempor = setTimeout("pasar()", tiempo)
}
gracias
Valora esta pregunta


0