-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.html
180 lines (167 loc) · 5.25 KB
/
index.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
<title>Automatic sub menu counters with CSS</title>
<style>
html {
overflow-y: scroll;
}
body {
font: normal normal 90% sans-serif;
max-width: 200px;
margin: 100px auto 50px auto;
background: #1f1f1f;
text-align: center;
}
ul {
list-style: none;
margin: 0; padding: 0;
text-align: left;
}
body > ul {
border: 1px solid #222;
box-shadow: 0 0 25px #000;
margin-bottom: 300px;
}
body > ul > li {
position: relative;
}
body > ul > li > a {
display: block;
outline: 0;
padding: .7em 1em;
text-decoration: none;
color: #FFF;
text-shadow: #111 0 -1px;
font-weight: bold;
background: #333;
background: -webkit-linear-gradient(#444, #333);
border-bottom: 1px solid #222;
box-shadow: inset 0 1px 0 0 rgba(250,250,250,0.1);
background: -webkit-linear-gradient(#444, #333);
background: -moz-linear-gradient(#444, #333);
background: -o-linear-gradient(#444, #333);
background: -ms-linear-gradient(#444, #333);
background: linear-gradient(#444, #333);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr="#444", EndColorStr="#333");
}
body > ul > li > ul {
counter-reset: items;
height: 0;
overflow: hidden;
background: #eee;
color: #777;
font-size: .75em;
box-shadow: inset 0 0 50px #BBB;
}
body > ul > li > ul > li {
counter-increment: items;
padding: .5em 1.3em;
border-bottom: 1px dotted #DDD;
}
body > ul > li > ul:after {
content: counter(items);
font-size: 0.857em;
display: inline-block;
position: absolute;
right: 10px;
top: 15px;
background: #333;
line-height: 1em;
height: 1em;
padding: .7em .8em;
margin: -.8em 0 0 0;
color: white;
text-indent: 0;
text-align: center;
text-shadow: 0px 1px 0px rgba(0, 0, 0, .5);
font-weight: 500;
-webkit-border-radius: .769em;
-moz-border-radius: .769em;
border-radius: .769em;
-webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26),
0px 1px 0px 0px rgba(255, 255, 255, .15);
-moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26),
0px 1px 0px 0px rgba(255, 255, 255, .15);
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26),
0px 1px 0px 0px rgba(255, 255, 255, .15);
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(function() {
$("a").click(function() {
var ul = $(this).next(),
clone = ul.clone().css({"height":"auto"}).appendTo("body"),
height = ul.css("height") === "0px" ? ul[0].scrollHeight + "px" : "0px";
clone.remove();
ul.animate({"height":height});
});
});
</script>
</head>
<body>
<ul>
<li>
<a href="#">Movies</a>
<ul>
<li>The Departed</li>
<li>Sherlock Holmes</li>
<li>Sin City</li>
<li>Jarhead</li>
<li>Jurassic Park</li>
<li>Machete</li>
</ul>
</li>
<li>
<a href="#">TV shows</a>
<ul>
<li>Dexter</li>
<li>Mad Men</li>
<li>Breaking Bad</li>
<li>Fringe</li>
<li>Game of Thrones</li>
<li>Californication</li>
<li>Homeland</li>
<li>Boardwalk Empire</li>
</ul>
</li>
<li>
<a href="#">Music</a>
<ul>
<li>B.B. King</li>
<li>Howlin' Wolf</li>
<li>Aretha Franklin</li>
<li>John Lee Hooker</li>
<li>Tom Waits</li>
<li>Jimi Hendrix</li>
<li>Muddy Waters</li>
<li>James Brown</li>
<li>Chuck Berry</li>
</ul>
</li>
<li>
<a href="#">Games</a>
<ul>
<li>Grand Theft Auto</li>
<li>Half-Life</li>
<li>Super Mario Galaxy</li>
<li>Resident Evil</li>
</ul>
</li>
</ul>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Automatic sub menu counters with CSS" data-via="lmgalmeida" data-related="lmgalmeida" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<a href="http://github.com/luis-almeida"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://a248.e.akamai.net/camo.github.com/bec6c51521dcc8148146135149fe06a9cc737577/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub"></a>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30673793-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>