/
index.html
205 lines (161 loc) · 7.06 KB
/
index.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<!DOCTYPE html>
<html lang="en">
<head>
<title>jQuery Hide / Show</title>
<meta charset="utf-8" />
<link rel="stylesheet" media="screen" href="gh-pages/css/normalize.css" />
<link rel="stylesheet" media="screen" href="gh-pages/css/styles.css" />
<link rel="stylesheet" media="screen" href="gh-pages/css/demo.css" />
<link rel="stylesheet" media="screen" href="gh-pages/css/rainbow/github.css" />
</head>
<body>
<div class="header">
<p><a href="http://nomensa.com?plugin"><img src="gh-pages/img/nomensa-logo.png" alt="Nomensa humanising technology" width="135" height="38"/></a></p>
</div><!-- .header -->
<div class="main" role="main">
<h1>jQuery Hide / Show</h1>
<p>Inserts an accessible buttons/links to hide and show sections of content.</p>
<h2>Example A</h2>
<p>An example with the default options.</p>
<div class="example exampleA">
<p>Text content to be hidden text content to be hidden text content to be hidden text content to be hidden</p>
</div><!-- .exampleA -->
<h3>Initialisation</h3>
<pre>
<code data-language="javascript">
$(".exampleA").hideShow();
</code>
</pre>
<h2 class="exampleB_heading">Example B</h2>
<p>An example with the trigger element inserted into a different location.</p>
<div class="example exampleB">
<p>Text content to be hidden text content to be hidden text content to be hidden text content to be hidden</p>
</div><!-- .exampleB -->
<h3>Initialisation</h3>
<pre>
<code data-language="javascript">
$(".exampleB").hideShow({
insertMethod: 'after',
insertTriggerLocation: '.exampleB_heading'
});
</code>
</pre>
<h2>Example C</h2>
<p>An example using an existing element on the page as the trigger element.</p>
<h3 id="triggerC">Contact details</h3>
<div class="example exampleC">
<p>Inserts an accessible buttons/links to hide and show sections of content.</p>
</div><!-- .exampleC -->
<h3>Initialisation</h3>
<pre>
<code data-language="javascript">
$(".exampleC").hideShow({
speed: '600',
state: 'hidden',
triggerElementTarget: '#triggerC'
});
</code>
</pre>
<h2>Example D</h2>
<p>An example that closes the content when clicking elsewhere in the document.</p>
<p>The content must have been opened up through a trigger press or click for this to work.</p>
<div class="example exampleD">
<p>Closes on click elsewhere in the document.</p>
</div><!-- .exampleC -->
<h3>Initialisation</h3>
<pre>
<code data-language="javascript">
$(".exampleD").hideShow({
closeOnClick: true
});
</code>
</pre>
<h2>Public methods</h2>
<div class="example exampleE">
<p>Text content to be hidden text content to be hidden text content to be hidden text content to be hidden</p>
</div><!-- .exampleE -->
<h3 id="triggerF">Contact details</h3>
<div class="example exampleF">
<p>Telephone 01234 567 890</p>
<p>Email <a href="mailto:test@test.com">test@test.com</a></p>
</div><!-- .exampleF -->
</div><!-- .main -->
<div class="footer">
<div>
<p><strong>jQuery.hideShow.js</strong> is licensed under the MIT License. <br />See the LICENSE.md file in the <a href="https://github.com/nomensa/jquery.hide-show">source code</a> for copy permission.</p>
</div>
</div><!-- .footer -->
<!-- Plugin scripts -->
<script src="gh-pages/js/vendor/jquery/1.11.1/jquery.min.js"></script>
<script src="gh-pages/js/vendor/rainbow/rainbow.min.js"></script>
<script src="gh-pages/js/vendor/rainbow/language/generic.js"></script>
<script src="gh-pages/js/vendor/rainbow/language/javascript.js"></script>
<script src="jquery.hideShow.js"></script>
<script>
$(document).ready( function(){
$('.exampleA').hideShow();
$('.exampleB').hideShow({
insertMethod: 'after',
insertTriggerLocation: '.exampleB_heading'
});
$('.exampleC').hideShow({
speed: '600',
state: 'hidden',
triggerElementTarget: '#triggerC'
});
$('.exampleD').hideShow({
closeOnClick: true
});
});
(function() {
var target = $('.exampleE'),
buttonContainer = $('<div />'),
buttonRebuild = $('<button class="js-btn">Rebuild</button>'),
buttonDestroy = $('<button class="js-btn">Destroy</button>');
target.hideShow();
buttonRebuild.attr('disabled', 'disabled');
buttonRebuild.on('click', function(event) {
event.preventDefault();
target.data('plugin_hideShow').rebuild();
$(this).attr('disabled', 'disabled');
buttonDestroy.removeAttr('disabled');
});
buttonDestroy.on('click', function(event) {
event.preventDefault();
target.data('plugin_hideShow').destroy();
$(this).attr('disabled', 'disabled');
buttonRebuild.removeAttr('disabled');
});
buttonContainer.append(buttonDestroy, buttonRebuild);
target.after(buttonContainer);
})();
(function() {
var target = $('.exampleF'),
buttonContainer = $('<div />'),
buttonRebuild = $('<button class="js-btn">Rebuild</button>'),
buttonDestroy = $('<button class="js-btn">Destroy</button>');
target.hideShow({
speed: '600',
state: 'hidden',
triggerElementTarget: '#triggerF',
triggerType: 'button'
});
buttonRebuild.attr('disabled', 'disabled');
buttonRebuild.on('click', function(event) {
event.preventDefault();
target.data('plugin_hideShow').rebuild();
$(this).attr('disabled', 'disabled');
buttonDestroy.removeAttr('disabled');
});
buttonDestroy.on('click', function(event) {
event.preventDefault();
target.data('plugin_hideShow').destroy();
$(this).attr('disabled', 'disabled');
buttonRebuild.removeAttr('disabled');
});
buttonContainer.append(buttonDestroy, buttonRebuild);
target.after(buttonContainer);
})();
</script>
</body>
</html>