aumentar tamaño imagen con event listener
Publicado por cesar (36 intervenciones) el 12/12/2019 20:23:40
amigos buenas les traigo este codigo el problema es que no desencadena ningun evento o sea no hace nada al tratar de que imagen crezca
anexo imagen
espero su ayuda dios sabra agradecerles

anexo imagen
espero su ayuda dios sabra agradecerles
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
<!DOCTYPE html>
<html lang="es">
<head>
<title>Html 5</title>
<script>
var imagen;
//function virgen2(){
alert('virgen del valle' );
}
//function dvirgen2(){
function manejaflor(){
//document.getElementsBytagName("ing")[0].onclick="virgen2()";
//addeventlistener
//var imagen = document.getElementsBytagName("ing")[0];
//imagen.addeventlistener("click", tipovirgen, false);
imagen=document.getElementsBytagName("ing")[0];
imagen.addeventlistener("click", crecer, false);
imagen.addeventlistener("mouseout", menguar, false);
}
function crecer(){
imagen.width =1225
imagen.height =1225
}
function menguar(){
imagen.width = 780
imagen.height =960
}
//window.onload("dvirgen2")
window.onload = manejaflor;
</script>
</head>
<body>
<p><img src= "img/virgen2.jpg" onclick="virgen2()"></p>
<img class="logo"src= "https://twitter.com/i/status/1204788840159989760">
</html>
</body>

Valora esta pregunta


0