
soy principiante, tengo 50 lineas y no encuentro error
Publicado por carlos avalos (2 intervenciones) el 17/07/2016 18:25:25
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>MANEJO DE EVENTOS</title>
<script>
var imagen new Array(3);
function manejaflor() {
for (var i=0; i<4; i++) {
imagen[i]=document.getElementsByTagName("img")[i];
}
imagen[0].addEventListener("mouseover", function() {imagen[0].width=225; imagen[0].height=225;},false);
imagen[0].addEventListener("mouseout", function() {imagen[0].width=200; imagen[0].height=200;},false);
imagen[0].addEventListener("click", flor,false);
imagen[1].addEventListener("mouseover", function() {imagen[1].width=225; imagen[1].height=225;},false);
imagen[1].addEventListener("mouseout", function() {imagen[1].width=200; imagen[1].height=200;},false);
imagen[1].addEventListener("click", flor,false);
imagen[2].addEventListener("mouseover", function() {imagen[2].width=225; imagen[2].height=225;},false);
imagen[2].addEventListener("mouseout", function() {imagen[2].width=200; imagen[2].height=200;},false);
imagen[2].addEventListener("click", flor,false);
imagen[3].addEventListener("mouseover", function() {imagen[3].width=225; imagen[3].height=225;},false);
imagen[3].addEventListener("mouseout", function() {imagen[3].width=200; imagen[3].height=200;},false);
imagen[3].addEventListener("click", flor,false);
}
function crecer() {
imagen.width=225;
imagen.height=225;
}
function decrecer() {
imagen.width=200;
imagen.height=200;
}
function flor() {
alert("pensamientos")
}
window.addEventListener("load",manejaflor,false);
</script>
</head>
<body>
<p>
<!---   non-breaking space --->
<img src="imagenes/1.jpg">
<img src="imagenes/2.jpg">
<img src="imagenes/3.jpg">
<img src="imagenes/4.jpg">
</p>
</body>
</html>
Valora esta pregunta


0