-
Notifications
You must be signed in to change notification settings - Fork 0
/
doublemenu.html
159 lines (153 loc) · 4.95 KB
/
doublemenu.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
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Scripted Pixels' Double menu</title>
<link rel="stylesheet" href="css/reset.css">
<style>
/* setup the very basis for the document */
body {
font-family: 'CodeLightRegular', 'Helvetica Neue';
text-align:center;
font-weight: lighter;
font-size: 16px;
line-height: 1.1;
padding: 0 0.5rem;
color: #fff;
min-width: 320px;
}
.container {
display: inline-block;
position: relative;
margin: 1rem auto 0;
max-width: 500px;
clear: both;
width: 100%;
}
a {
color: #f0f0f0;
text-decoration: none;
}
p {
margin: 0 auto 1rem;
letter-spacing: 0.1rem;
}
#mobile_menu, #share_menu {
width: 49.9%;
min-height: 25px;
background: #BD2026;
float: left;
position: relative;
margin-bottom: 0;
}
#share_menu {
float: right;
}
#mobile_menu > a,
#share_menu > a {
letter-spacing: 5px;
padding: 12px 11px 10px;
padding: 1.2rem 1.1rem 1.0rem;
height: 100%;
width: auto;
display: block;
}
#share_menu > a {
text-align: right;
}
#mobile_menu .menu,
#share_menu .menu {
padding: 1rem;
background: #BD2026;
position: absolute;
z-index: 99999;
display: none;
width: 100%;
top: 102%;
left: 0;
height: auto;
}
#mobile_menu .menu li,
#share_menu .menu li {
border-bottom: 1px solid rgba(255,255,255,0.3);
display: inline-block;
line-height: 3rem;
min-height: 10px;
width: 100%;
}
#mobile_menu .menu li:last-child,
#share_menu .menu li:last-child {
border-bottom: none;
}
</style>
</head>
<body>
<div class="container">
<div id="mobile_menu" >
<a href="#" id="mobileMenuButton" >Menu</a>
<div id="menu">
<ul class="menu">
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
<li> Item 4 </li>
</ul>
</div>
</div>
<!-- share -->
<div id="share_menu" >
<a href="#" id="mobileShareButton" >Share</a>
<div id="share">
<ul class="menu">
<li> Item 1 </li>
<li> Item 2 </li>
<li> Item 3 </li>
<li> Item 4 </li>
</ul>
</div>
</div>
</div>
<!-- jQuery libraries -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/detectmobilebrowser.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<!-- TOUCH EVENTS -->
<script src="js/jquery.tappable.js"></script>
<script>
jQuery(document).ready(function($){
var menu = $('#mobile_menu .menu');
var share = $('#share_menu .menu');
$("#mobileMenuButton").bind('click', function(event) {
event.preventDefault();
if (share.is(":visible")) {
share.slideUp( 300 );
};
if (menu.is(":visible")) {
menu.slideUp(300, 'easeInOutSine', {complete:function(){
$(this).css('display','');
}
});
} else {
menu.slideDown(300, 'easeInOutSine');
};
});
$('#mobileShareButton').bind('click', function(event) {
event.preventDefault();
if (menu.is(":visible")) {
menu.slideUp( 300 );
};
if (share.is(":visible")) {
share.slideUp(500, 'easeInOutSine', { complete:function(){
$(this).css('display','');
}
});
} else {
share.slideDown(300, 'easeInOutSine');
};
});
});
</script>
</body>
</html>