-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhover-follow.html
100 lines (82 loc) · 2.53 KB
/
hover-follow.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!-- [email protected] -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hover Follow</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="hover-list">
<h1>List of Things</h1>
<ul>
<li class="hover-object">
<a href="#">
<h3>
<span class="circle" style="background-color: #2d2d;"></span>
<span>Cleona </span>
<span class="type-thin block">description describing what this describes</span>
</h3>
<img class="hover-img" alt="" src="https://placeimg.com/640/480/arch" />
</a>
</li>
<li class="hover-object">
<a href="#">
<h3>
<span class="circle" style="background-color: #E4B280;"></span>
<span>Tesla </span>
<span class="type-thin block">description of this descriptive description</span>
</h3>
<img class="hover-img" alt="" src="https://placeimg.com/480/640/arch" />
</a>
</li>
<li class="hover-object">
<a href="#">
<h3>
<span class="circle" style="background-color: #1A6FE6;"></span>
<span>Charlie </span>
<span class="type-thin block">description describing what this may describe</span>
</h3>
<img class="hover-img" alt="" src="https://placeimg.com/800/400/arch" />
</a>
</li>
<li class="hover-object">
<a href="#">
<h3>
<span class="circle" style="background-color: #7B684B;"></span>
<span>HoverBro </span>
<span class="type-thin block">description describing this description</span>
</h3>
<img class="hover-img" alt="" src="https://placeimg.com/480/640/arch" />
</a>
</li>
<li class="hover-object">
<a href="#">
<h3>
<span class="circle" style="background-color: #646464;"></span>
<span>Storage </span>
<span class="type-thin block">description describing what this describes</span>
</h3>
<img class="hover-img" alt="" src="https://placeimg.com/640/480/arch" />
</a>
</li>
</ul>
</div>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var tooltips = document.querySelectorAll('.hover-object img');
window.onmousemove = function(e) {
var x = (e.clientX + 50) + 'px',
y = (e.clientY - 200) + 'px';
for (var i = 0; i < tooltips.length; i++) {
tooltips[i].style.top = y;
tooltips[i].style.left = x;
}
};
console.log('I just ran');
});
</script>
</body>
</html>