forked from felippepuhle/aero-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
js_tabs.html
170 lines (148 loc) · 6.76 KB
/
js_tabs.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
---
layout: admin
title: Javascript - Tabs
section: js
module: js_tabs
header:
icon: tab
title: Tabs
description: The tabs structure consists of an unordered list of tabs that have hashes corresponding to tab ids. Then when you click on each tab, only the container with the corresponding tab id will become visible. You can add the class .disabled to make a tab inaccessible.
---
<section id="js_tabs">
<!-- ############ -->
<!-- Introduction -->
<!-- ############ -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Introduction</h4>
<ul class="tabs tab-demo z-depth-1">
<li class="tab col s3"><a href="#test1">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test2">Test 2</a></li>
<li class="tab col s3 disabled"><a href="#test3">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test4">Test 4</a></li>
<li class="tab col s3"><a href="#test0">Test 5</a></li>
</ul>
<div id="test1" class="col s12"><p>Test 1</p></div>
<div id="test2" class="col s12"><p>Test 2</p></div>
<div id="test3" class="col s12"><p>Test 3</p></div>
<div id="test4" class="col s12"><p>Test 4</p></div>
<div id="test0" class="col s12"><p>Test 5</p></div>
</div>
</div>
<!-- ############### -->
<!-- Scrollable tabs -->
<!-- ############### -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Scrollable tabs</h4>
<ul class="tabs tab-demo z-depth-1">
<li class="tab col s3"><a href="#test5">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test6">Test 2</a></li>
<li class="tab col s3"><a href="#test7">Test 4</a></li>
<li class="tab col s3"><a href="#test8">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test9">Test 2</a></li>
<li class="tab col s3 disabled"><a href="#test10">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test11">Test 4</a></li>
<li class="tab col s3"><a href="#test12">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test13">Test 2</a></li>
<li class="tab col s3 disabled"><a href="#test14">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test15">Test 4</a></li>
<li class="tab col s3 disabled"><a href="#test20">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test21">Test 4</a></li>
<li class="tab col s3"><a href="#test22">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test23">Test 2</a></li>
<li class="tab col s3 disabled"><a href="#test24">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test25">Test 4</a></li>
</ul>
<div id="test5" class="col s12"><p>Test 5</p></div>
<div id="test6" class="col s12"><p>Test 6</p></div>
<div id="test7" class="col s12"><p>Test 7</p></div>
<div id="test8" class="col s12"><p>Test 8</p></div>
<div id="test9" class="col s12"><p>Test 9</p></div>
<div id="test10" class="col s12"><p>Test 10</p></div>
<div id="test11" class="col s12"><p>Test 11</p></div>
<div id="test12" class="col s12"><p>Test 12</p></div>
<div id="test13" class="col s12"><p>Test 13</p></div>
<div id="test14" class="col s12"><p>Test 14</p></div>
<div id="test15" class="col s12"><p>Test 15</p></div>
<div id="test20" class="col s12"><p>Test 20</p></div>
<div id="test21" class="col s12"><p>Test 21</p></div>
<div id="test22" class="col s12"><p>Test 22</p></div>
<div id="test23" class="col s12"><p>Test 23</p></div>
<div id="test24" class="col s12"><p>Test 24</p></div>
<div id="test25" class="col s12"><p>Test 25</p></div>
</div>
</div>
<!-- ################### -->
<!-- Tabs HTML Structure -->
<!-- ################### -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Tabs HTML Structure</h4>
<pre>
<code class="language-markup">
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a href="#test1">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test2">Test 2</a></li>
<li class="tab col s3 disabled"><a href="#test3">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test4">Test 4</a></li>
</ul>
</div>
<div id="test1" class="col s12">Test 1</div>
<div id="test2" class="col s12">Test 2</div>
<div id="test3" class="col s12">Test 3</div>
<div id="test4" class="col s12">Test 4</div>
</div>
</code>
</pre>
</div>
</div>
<!-- ############################ -->
<!-- jQuery Plugin Initialization -->
<!-- ############################ -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">jQuery Plugin Initialization</h4>
<p>Tabs are initialized automatically, but if you add tabs dynamically you will have to initialize them like this.</p>
<pre>
<code class="language-javascript">
$(document).ready(function(){
$('ul.tabs').tabs();
});
</code>
</pre>
</div>
</div>
<!-- ##################### -->
<!-- jQuery Plugin Methods -->
<!-- ##################### -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">jQuery Plugin Methods</h4>
<p>You can programmatically trigger a tab change with our <code class="language-javascript">select_tab</code> method. You have to input the id of the tab you want to switch to. In the case of our demo it would be either test1, test2, test3, or test4.</p>
<pre>
<code class="language-javascript">
$(document).ready(function(){
$('ul.tabs').tabs('select_tab', 'tab_id');
});
</code>
</pre>
</div>
</div>
<!-- ################## -->
<!-- Preselecting a tab -->
<!-- ################## -->
<div class="row">
<div class="col s12">
<h4 class="main-text lighten-1">Preselecting a tab</h4>
<p>By default, the first tab is selected. But if this is not what you want, you can preselect a tab by either passing in the hash in the url ex:<code class="language-markup">#test2</code>. Or you can add the class <code class="language-markup">active</code> to the <code class="language-markup">a</code> tag.</p>
<pre>
<code class="language-javascript">
<li class="tab col s2"><a class="active" href="#test3">Test 3</a></li>
</code>
</pre>
</div>
</div>
</section>