This repository was archived by the owner on May 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresponsive-demo.html
More file actions
129 lines (119 loc) · 5.23 KB
/
responsive-demo.html
File metadata and controls
129 lines (119 loc) · 5.23 KB
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
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Responsive Dropdown Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
body { font-family: sans-serif; }
::selection { color: #fff; background: #000; }
header h1 { padding: 20px; font-weight: normal; margin-bottom: 0;}
p { padding: 0px 20px; line-height: 1.5em; }
h2 { padding: 0px 20px; }
section { color: #999; }
section:hover { color: #000; }
section:hover header h1 { background: #000; }
section:hover pre { border-color: #000; }
section header h1 { margin: 20px 20px 0px 20px; background: #999; color: #fff; padding: 15px 10px;}
pre { margin: 0px 20px; border: 2px solid #999; padding: 10px; overflow: auto;}
/* Navigation CSS */
nav { border: 2px solid #000; margin: 0px 20px;}
nav ul { padding: 0; margin: 0; list-style: none; }
nav ul li a { display: block; padding: 10px; background: #fff; color: #000; text-decoration: none; }
nav ul li a:hover { background: #000; color: #fff; }
nav ul li a strong { float: right; font-size: 8px; margin-top: 5px; }
nav.desktop ul li { display: inline; }
nav.desktop ul li a { display: inline-block; margin-right: 4px; }
</style>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header>
<h1>Responsive Dropdown Demo</h1>
</header>
<nav>
<ul>
<li><a href="#">Link One</a></li>
<li><a href="#">Link Two</a></li>
<li><a href="#">Link Three</a></li>
<li><a href="#">Link Four</a></li>
<li><a href="#">Link Five</a></li>
</ul>
</nav>
<p>Resize this browser window to switch between mobile and desktop navigation.</p>
<p>You will need jQuery, the <a href="http://www.github.com/Lane/Dropdown">dropdown</a> plugin (~1.3KB), and the
<a href="http://www.github.com/Lane/Responder">responder</a> plugin (~1.2KB) to replicate this demo.</p>
<section>
<header>
<h1>The HTML</h1>
</header>
<pre><nav>
<ul>
<li><a href="#">Link One</a></li>
<li><a href="#">Link Two</a></li>
<li><a href="#">Link Three</a></li>
<li><a href="#">Link Four</a></li>
<li><a href="#">Link Five</a></li>
</ul>
</nav></pre>
</section>
<section>
<header>
<h1>The CSS</h1>
</header>
<pre>nav { border: 2px solid #000; margin: 0px 20px;}
nav ul { padding: 0; margin: 0; list-style: none; }
nav ul li a { display: block; padding: 10px; background: #fff; color: #000; text-decoration: none; }
nav ul li a:hover { background: #000; color: #fff; }
nav ul li a strong { float: right; font-size: 8px; margin-top: 5px; }
nav.desktop ul li { display: inline; }
nav.desktop ul li a { display: inline-block; margin-right: 4px; }</pre>
</section>
<section>
<header>
<h1>The Javascript</h1>
</header>
<pre>$(document).ready(function()
{
var navElement = $("nav");
navElement.dropdown().responder({
breakpoints: [
new $.responsive.Breakpoint(0, "mobile", function() {
navElement.trigger("createdropdown");
}),
new $.responsive.Breakpoint(768, "desktop", function() {
navElement.trigger("destroydropdown");
})
]
});
});</pre>
</section>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="dropdown.min.js"></script>
<script src="https://raw.github.com/Lane/Responder/master/responder.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
var navElement = $('nav');
navElement.dropdown().responder({
breakpoints: [
new $.responsive.Breakpoint(0, "mobile", function() {
navElement.trigger('createdropdown');
}),
new $.responsive.Breakpoint(767, "desktop", function() {
navElement.trigger('destroydropdown');
})
]
});
});
</script>
</body>
</html>