/
setup.html
63 lines (55 loc) · 2.71 KB
/
setup.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
<h2>Set Up</h2>
<p>In order to let simple-sidebar work, you have to set up this template. Classes and Ids are at your discretion.</p>
<pre>
<div id="wrapper">
<!--
All your content must go here.
This wrapper must be relative positioned, unless Simple-Sidebar won't work properely.
* Every POSITION-FIXED ELEMENT must be positioned outside of this wrapper.
* Every POSITION-ABSOLUTE ELEMENT must be positioned inside a POSITION-RELATIVE div.
-->
</div>
<div id="navbar">
<!--
#navbar is positioned fixed.
It does not matter what element #toggle-sidebar is, give it a selector (in this example #toggle-sidebar).
-->
<span id="toggle-sidebar" class="button icon"></span>
</div>
<div id="sidebar">
<!--
Simple-Sidebar will handle #sidebar's position.
Links below are just an example. Give each clickable element, for example links, a class to trigger the closing animation.
-->
<a class="close-sidebar" href="#">Link</a>
<a class="close-sidebar" href="#">Link</a>
<a class="close-sidebar" href="#">Link</a>
<a class="close-sidebar" href="#">Link</a>
</div>
</pre>
<p>At the bottom of the web page, just before the <code></body></code> tag, include the <b>jQuery</b> library. If you are interested in better <i>easing</i>, include the <b>jQuery-UI</b> library too. Eventually include Simple-Sidebar.</p>
<pre>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="/dist/jquery.simple-sidebar.min.js"></script>
</pre>
<p>Call the Simple-Sidebar plug-in function and fill it with the options you need. Here is an example of some required options.</p>
<pre>
<script>
$(document).ready(function() {
$('#sidebar').simpleSidebar({
opener: '#button',
wrapper: '#wrapper',
sidebar: {
align: 'left', //or 'right' - This option can be ignored, the sidebar will automatically align to right.
width: 300, //You can ignore this option, the sidebar will automatically size itself to 300px.
closingLinks: '.close-sidebar' // If you ignore this option, the plug-in will look for all links and this can be buggy. Choose a class for every object inside the sidebar that once clicked will close the sidebar.
css: {
//Here you can add more css rules but you should use your own stylesheet.
zIndex: 3000 //Choose the amount of zIndex you want. It must be the higher zIndex number.
}
}
});
});
</script>
</pre>