-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathtoggle.html
More file actions
186 lines (138 loc) · 6.4 KB
/
Copy pathtoggle.html
File metadata and controls
186 lines (138 loc) · 6.4 KB
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
<!DOCTYPE html>
<html lang="en-gb" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Toggle - UIkit tests</title>
<script src="js/test.js"></script>
</head>
<body>
<div class="uk-container">
<h1>Toggle</h1>
<div class="uk-child-width-1-5@m" uk-grid>
<div>
<h3>One item</h3>
<p>
<button class="uk-button uk-button-default" type="button" uk-toggle="target: #toggle1">Button</button>
<a href uk-toggle="target: #toggle1">Link</a>
</p>
<p id="toggle1">What's up?</p>
</div>
<div>
<h3>Two items</h3>
<button class="uk-button uk-button-default" type="button" uk-toggle="target: ~">Toggle</button>
<p>Hello!</p>
<p hidden>Bazinga!</p>
</div>
<div>
<h3>Multiple toggles</h3>
<div class="toggle3">
<button class="uk-button uk-button-default" type="button" uk-toggle="target: .toggle3">Next</button>
<p>Hello!</p>
</div>
<div class="toggle3" hidden>
<button class="uk-button uk-button-default" type="button" uk-toggle="target: .toggle3">Previous</button>
<p>Bazinga!</p>
</div>
</div>
<div>
<h3>Multiple targets</h3>
<button class="uk-button uk-button-default uk-margin uk-display-block" uk-toggle="target: ~">Go</button>
<span>What's up?</span>
<span>Hello!</span>
<p hidden>Bazinga!</p>
</div>
<div>
<h3>Custom class</h3>
<button class="uk-button uk-button-default" uk-toggle="target: +; cls: uk-alert-success">Toggle</button>
<p class="uk-alert">What's up?</p>
</div>
<div>
<h3>Animation</h3>
<button class="uk-button uk-button-default" uk-toggle="target: +; animation: uk-animation-fade">Toggle</button>
<p>Animation</p>
</div>
<div>
<h3>In/Out Animations</h3>
<button class="uk-button uk-button-default" type="button" uk-toggle="target: +; animation: uk-animation-slide-left, uk-animation-slide-top">Toggle</button>
<p>Animation</p>
</div>
<div>
<h3>Queued</h3>
<button class="uk-button uk-button-default" type="button" uk-toggle="target: ~; animation: uk-animation-fade; duration: 500; queued: true">Queued</button>
<p>Animation</p>
<p hidden>Bazinga!</p>
</div>
<div class="uk-width-expand@m">
<h3>Mode Media</h3>
<div class="uk-alert uk-alert-danger" uk-toggle="cls: uk-alert-success uk-alert-danger; mode: media; media: @xl">
Only visibly @xl
</div>
</div>
<div>
<h3>Mode Hover</h3>
<button class="uk-button uk-button-default" type="button" uk-toggle="target: ~; mode: hover">Hover, Focus</button>
<p>What's up?</p>
<p hidden>Hovered, Focused</p>
</div>
</div>
<h2>JavaScript Options</h2>
<div class="uk-overflow-auto">
<table class="uk-table uk-table-striped">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>target</code></td>
<td>CSS selector</td>
<td>false</td>
<td>The element(s) to toggle.</td>
</tr>
<tr>
<td><code>mode</code></td>
<td>String</td>
<td>click</td>
<td>Comma-separated list of trigger behaviour modes (hover, click, media).</td>
</tr>
<tr>
<td><code>media</code></td>
<td>Boolean, Number, String</td>
<td>false</td>
<td>Condition to trigger the toggle in media mode - a width as integer (e.g. 640) or a breakpoint (e.g. @s, @m, @l, @xl) or any valid media query (e.g. (min-width: 900px)).</td>
</tr>
<tr>
<td><code>cls</code></td>
<td>String</td>
<td>false</td>
<td>The class that is being toggled. Defaults to the "hidden" attribute.</td>
</tr>
<tr>
<td><code>animation</code></td>
<td>String</td>
<td>false</td>
<td>Space-separated names of animations. Comma-separated for animation out.</td>
</tr>
<tr>
<td><code>duration</code></td>
<td>Number</td>
<td>200</td>
<td>The animation duration.</td>
</tr>
<tr>
<td><code>queued</code></td>
<td>Boolean</td>
<td>true</td>
<td>Toggle the targets successively.</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>