-
Notifications
You must be signed in to change notification settings - Fork 5
/
example.html
107 lines (107 loc) · 3.38 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TITLE</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="duplicity.js" type="text/javascript"></script>
<style type="text/css">
html, body{
padding:0;
margin:0;
font-family:"helvetica", "arial", sans-serif;
}
#navbar{
background-color:#333;
}
#logo{
font-weight:bold;
display:inline-block;
color:#D8005F;
font-size:20px;
padding:5px;
}
#navbarButtons{
display:inline-block;
}
#navbarButtons a{
color:#FFF;
text-decoration:none;
padding:5px;
padding-top:10px;
}
#navbarButtons a:hover{
background-color:#666;
}
#navbarAppear{
color:#FFF;
text-decoration:none;
float:right;
padding:5px;
padding-top:10px;
}
#navbarAppear:hover{
background-color:#666;
}
/* for phones */
.phone #navbarButtons{
position:fixed;
width:200px;
border:2px solid #222;
background-color:#333;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.75);
margin:auto;
top:50px;
left:50%;
margin-left:-100px;
}
.phone #navbarButtons a{
display:block;
}
</style>
<script type="text/javascript">
function toggleMenu(){
if ($('#navbarButtons').css('display') != 'none'){
$('#navbarButtons').css('display', 'none');
}
else {
$('#navbarButtons').css('display', '');
}
}
function screenSizeChanged(oldDevice, newDevice){
if (!duplicity.phone && $('#navbarButtons').css('display') == 'none'){
toggleMenu();
}
if (duplicity.phone){
toggleMenu();
}
}
$(document).ready(function (){
$("#navbarAppear").bind('click', toggleMenu);
if (duplicity.phone){
toggleMenu();
}
});
</script>
</head>
<body>
<div id="navbar">
<div id="logo">
Logo
</div>
<a data-display="phone" href="#" id="navbarAppear">
Menu
</a>
<div id="navbarButtons">
<a href="http://google.com">Link A</a>
<a href="http://facebook.com">Link B</a>
<a href="http://twitter.com">Link C</a>
</div>
<div>
</body>
</html>