-
Notifications
You must be signed in to change notification settings - Fork 4
/
test-hover.html
87 lines (75 loc) · 2.09 KB
/
test-hover.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
<!DOCTYPE html>
<!-- saved from url=(0037)http://www.qatools.ro/test-hover.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<style>
:root {
--menu1-color: blue;
--menu2-color: indianred;
}
hr{
height: 2px;
border-width: 0;
}
#menu1{
color: var(--menu1-color);
}
#menu1 hr{
background-color: var(--menu1-color);;
}
#menu2{
color: var(--menu2-color);
}
#menu2 hr{
background-color: var(--menu2-color);
}
#menu2:hover .buttons-wrapper{
opacity: 1;
}
span{
margin-left: 20px;
font-weight: bold;
}
.buttons-wrapper{
opacity: 0;
}
</style>
</head>
<body data-new-gr-c-s-check-loaded="14.1005.0" data-gr-ext-installed=""><div id="hebbia_popup_outer" class="hebbia_closed" style="display: none; top: 30px; left: 1383px;"><div></div></div>
<h1>Test Hover</h1>
<br>
<div id="menu1" onmouseover="setOpacity(1)" onmouseout="setOpacity(0)">
<hr>
<span>Menu1</span>
<span class="buttons-wrapper" style="opacity: 0;">
<span id="left11"><</span>
<span id="right12">></span>
</span>
<hr>
</div>
<br><br>
<div id="menu2">
<hr>
<span>Menu2</span>
<span class="buttons-wrapper">
<span id="left21"><</span>
<span id="right22">></span>
</span>
<hr>
</div>
<script>
const setOpacity = opacity =>
document.querySelector('#menu1 .buttons-wrapper').style.opacity = opacity;
const addMenuButtons = () =>
document.querySelectorAll('[id^=menu]').forEach(
(menuElement, index) => menuElement.innerHTML = `
<hr>
<span>Menu${index + 1}</span>
<span class="buttons-wrapper">
<span id="left${index + 1}1"><</span>
<span id="right${index + 1}2">></span>
</span>
<hr>
`);
addMenuButtons();
</script>
</body></html>