-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
107 lines (93 loc) · 3.15 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
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<body id="site-wrapper">
<div id="site-canvas">
<div id="site-menu">
<h2>Example menu</h1>
<div>item 1</div>
<div>item 2</div>
<div>item 3</div>
<div>item 4</div>
<div>item 5</div>
<div id="close-menu">Close Menu</div>
</div>
<h1 class="">SlideMenu.js</h1>
<a href="#" class="logo m" id="logo"><i class="fa fa-bars"></i><span>Menu</span></a>
<p class="">Easy off-canvas demo using SlideMenu.js</p>
<p><a href="https://github.com/AlexKratky/SlideMenu.js" class="link">Visit GitHub repository</a></a></p>
<p style="margin-top: 40px;">© <a href="https://alexkratky.cz/" class="link">Alex Kratky</a> 2018</p>
</div>
</body>
<link rel="stylesheet" href="SlideMenu.css">
<style>
/*Demo css, not important*/
* {
font-family: 'Roboto', sans-serif;
}
body {
height: 200%;
}
.m {
font-size: 30px;
text-decoration: none;
color: #00b6ff;
display: inline-block;
padding-top: 10px;
padding-bottom: 10px;
}
.m a:hover i {
-webkit-transform: scale(1.5);
}
.m a:hover {}
.m i,
.m span {
margin-right: 10px;
display: inline-block;
text-align: center;
-webkit-transform: scale(1);
transform: scale(1);
-webkit-transition: all 400ms cubic-bezier(0.32, 1.25, 0.375, 1.15);
transition: all 400ms cubic-bezier(0.32, 1.25, 0.375, 1.15);
}
body {
/*box-shadow: inset 0 0 100px rgba(0, 0, 0, .5);*/
background-color: #333;
color: #fff;
}
.link {
color: #00b6ff;
text-decoration: none;
}
.link:hover {
text-decoration: underline;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="SlideMenu.js"></script>
<script>
var sm;
$(document).ready(function () {
sm = new SlideMenu(window.jQuery || window.$, {
/*
//If you are using default IDs, you don't really need to enter this, but if you are using for example button to open a menu with a different ID than #logo, you need to change it.
'container': document.querySelector('body'),
'wrapper': document.getElementById('site-wrapper'),
'canvas': document.getElementById('site-canvas'),
'button': document.getElementById('logo'),
*/
'closeMenuOnWidth': 680,
//'disableMenuOnWidth': 680,
'debug': true
});
// additional listeners
$("#close-menu").on('click', function() {
sm.closeMenu();
});
$(document).on('menuToggle', function () { console.log("menuToggle"); });
$(document).on('menuOpenEnded menuToggleEnded', function() {
//setTimeout(function () { alert("opened"); }, 300);
console.log("menu's animation ended after 300 ms");
});
});
</script>