-
Notifications
You must be signed in to change notification settings - Fork 207
/
demo.html
70 lines (57 loc) · 1.84 KB
/
demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>TinyNav.js · Convert navigation to a tiny select box on small screen</title>
<style>
/* styles for desktop */
.tinynav { display: none }
#nav .selected a, #nav2 .selected a { color: red }
/* styles for mobile */
@media screen and (max-width: 600px) {
.tinynav { display: block }
#nav, #nav2 { display: none }
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="tinynav.min.js"></script>
<script>
$(function () {
// TinyNav.js 1
$('#nav').tinyNav({
active: 'selected',
indent: '→',
label: 'Menu'
});
// TinyNav.js 2
$('#nav2').tinyNav({
header: 'Navigation' // Writing any title with this option triggers the header
});
});
</script>
</head>
<body>
<h1>TinyNav.js</h1>
<ul id="nav">
<li><a href="http://google.com">Google</a></li>
<li class="selected"><a href="demo.html">Demo page</a></li>
<li><a href="http://bing.com">Bing</a>
<ul>
<li><a href="http://google.com">Google</a></li>
<li><a href="demo.html">Demo page</a></li>
<li><a href="http://bing.com">Bing</a></li>
<li><a href="http://yahoo.com">Yahoo</a></li>
</ul>
</li>
<li><a href="http://yahoo.com">Yahoo</a></li>
</ul>
<ul id="nav2">
<li><a href="http://google.com">Google</a></li>
<li><a href="demo.html">Demo page</a></li>
<li class="selected"><a href="http://bing.com">Bing</a></li>
<li><a href="http://yahoo.com">Yahoo</a></li>
</ul>
<p><a href="http://tinynav.viljamis.com/">See the documentation</a></p>
</body>
</html>