-
Notifications
You must be signed in to change notification settings - Fork 0
/
dropmenu_04.html
71 lines (64 loc) · 1.41 KB
/
dropmenu_04.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Drop Menu: Step 4</title>
<link rel="stylesheet" href="css/dropmenu.css">
<style type="text/css">
dl.drop-menu
{
position: absolute;
left: 50%;
margin-top: 30px;
margin-left: -80px;
z-index: 1;
}
dl.drop-menu dt
{
position: relative;
z-index: 1;
}
dl.drop-menu dd
{
margin-top: -50px;
transition-property: margin-top;
transition-duration: 200ms;
transition-timing-function: ease-in;
}
dl.drop-menu:hover dd
{
margin-top: -1px;
transition-duration: 300ms;
transition-timing-function: ease-out;
}
</style>
</head>
<body>
<nav>
<dl class="drop-menu">
<dt>Days of the Week</dt>
<dd>Monday</dd>
<dd>Tuesday</dd>
<dd>Wednesday</dd>
<dd>Thursday</dd>
<dd>Friday</dd>
<dd>Saturday</dd>
<dd>Sunday</dd>
</dl>
</nav>
<section>
<p>A CSS Drop Menu.</p>
</section>
<script>
/* DROP-CSS
*
* 1. This menu opens and closes like it should -- with NO JavaScript -- but how could the clicks work?
* 2. Of course, CSS won't respond to clicks, but the JavaScript could be a lot simpler now.
* 3. Try your hand at adding a click handler to the .drop-menu and then responding to each item.
*
* HINT: Remember the event.target to know which .drop-menu item was clicked on!
*
*/
</script>
</body>
</html>