-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzoom.html
76 lines (66 loc) · 1.67 KB
/
zoom.html
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
* {
box-sizing: border-box;
}
.img-zoom-container {
position: relative;
}
.img-zoom-lens {
position: absolute;
border: 1px solid #d4d4d4;
/*set the size of the lens:*/
width: 40px;
height: 40px;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.301);
}
.img-zoom-result {
position: absolute;
width: 300px;
height: 300px;
border: 1px solid #d4d4d4;
border-radius: 10px;
}
.img-zoom-result.on {
animation: aparece 0.5s;
}
@keyframes aparece {
to {
opacity: 1;
}
from {
opacity: 0;
}
}
</style>
<script>
</script>
</head>
<body>
<h1>Image Zoom</h1>
<p>Mouse over the image:</p>
<div class="img-zoom-container">
<img id="myimage" src="./img/protuto-2.jpg" width="300" height="240" />
<div id="myresult" class="img-zoom-result"></div>
</div>
<p>
The image must be placed inside a container with relative positioning.
</p>
<p>
The result can be put anywhere on the page, but must have the class name
"img-zoom-result".
</p>
<p>
Make sure both the image and the result have IDs. These IDs are used when
a javaScript initiates the zoom effect.
</p>
<script>
// Initiate zoom effect:
imageZoom("myimage", "myresult");
</script>
</body>
</html>