-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTab.html
329 lines (304 loc) · 10.4 KB
/
Tab.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<link rel="stylesheet" href="css/asdui1.4b.css" type="text/css" media="all" />
<style type="text/css">
a:link,a:visited{color:#f00; text-decoration:underline}
fieldset{margin:20px 10px}
pre{border:1px solid #fc0;background:#ffd;padding:5px}
fieldset{margin:20px;padding:20px;text-align:left}
fieldset legend{padding:5px 10px;font-weight:700;font-size:16px}
table{color:#333;background:#E8F5FE;border-collapse:collapse;width:100%;text-align:left;}
thead{}
thead th{padding:1em 1em .5em;border:1px solid #5C9CC0;font-size:120%;background:#5C9CC0;text-align:left}
thead tr{}
td{padding:.5em 1em;border:1px solid #BBE1F1}
tbody td{background:#EEFAFF;}
tfoot{background-color:#A9C9E2;}
tfoot td{padding-bottom:1.5em;border:1px solid #BBE1F1}
dl{padding:10px 5px}
dl dt{font-weight:700;font-sie:14px;padding:5px 0;}
dl dt span{color:#f60;padding:0 8px}
pre{border:1px solid #ADCD3C;background-color:#F2FDDB;padding:5px;white-space: pre-wrap;
word-wrap: break-word;}
</style>
</head>
<body>
<fieldset>
<legend>ASDUI.Tab Class</legend>
<h2 align="center" style="padding:100px 0">
<a href="javascript:void(0)" id="show">Add Tab1</a>||<a href="javascript:void(0)" id="show2">Add Tab2</a>||<a href="javascript:void(0)" id="showac">Action</a>
</h2>
<div id="demo_a" class="box w1">
<div class="hd">
<ul class="tab-holder" id="myul">
<li class="tab"><a href="javascript:void(0)">HTML5 </a></li>
<li class="tab"><a href="javascript:void(0)">MooTools </a></li>
<li class="tab"><a href="javascript:void(0)">Dojo </a></li>
<li class="tab"><a href="javascript:void(0)">jQuery </a></li>
</ul>
<em class="ASD-left"></em>
<em class="ASD-right"></em>
</div>
<div class="bd" id="mypan">
<div class="tab-panel">
<div id="mo">
<form id="fm1">
<input type="text" value=""/>
</form>
<h2>aaaaaaaaaaajj</h2>
<br />
<h2>aaaaaaaaaaajj</h2>
<br />
<h2>aaaaaaaaaaajj</h2>
<br />
<h2>aaaaaaaaaaajj</h2>
<br />
<h2>aaaaaaaaaaajj</h2>
<br />
</div>
</div>
<div class="tab-panel hide">
<ul>
<li>
<a href="http://cssrainbow.cn/articles/resources/1357.html">9大MooTools Plugins来改善网站的用户体验</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1347.html">盒子(Box)中间的链接(Links),基于MooTools or jQuery</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1331.html">打破重复的动画效果,基于CSS,MooTools or jQuery</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/mootools/1327.html">MooTools FormCheck 功能完善的表单验证插件</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/mootools/1324.html">文本字段/文本区域的默认值自动显示和隐藏</a>
</li>
</ul>
</div>
<div class="tab-panel hide">
<ul>
<li>
<a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类 »</a>
</li>
<li>
<a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类 »</a>
</li>
<li>
<a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类 »</a>
</li>
<li>
<a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类 »</a>
</li>
<li>
<a href="http://cssrainbow.cn/code-snippets/mootools-code-snippets/1342.html">使用MooTools, jQuery, and Dojo 来完成常见任务的语法归类 »</a>
</li>
</ul>
</div>
<div class="tab-panel hide">
<ul>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1347.html">盒子(Box)中间的链接(Links),基于MooTools or jQuery</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1331.html">打破重复的动画效果,基于CSS,MooTools or jQuery</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1321.html">简单的,流行的,可交换的图片字幕,基于CSS and MooTools</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1318.html">GitHub-Style的按钮 ,基于CSS and MooTools , jQuery</a>
</li>
<li>
<a href="http://cssrainbow.cn/tutorials/jquery/1251.html">网站功能列表插件,基于MooTools or jQuery</a>
</li>
</ul>
</div>
</div>
</div>
<p> </p>
<h2 align="center">风格二</h2>
<div id="demo_b" class="w2">
<div class="tabs-trigger">
<a class="tab2" href="javascript:void(0)">标签一</a>
<a class="tab2" href="javascript:void(0)">标签二</a>
<a class="tab2" href="javascript:void(0)">标签三</a>
<a class="tab2" href="javascript:void(0)">标签四</a>
</div>
<div class="tabs-panel">
<p>Tab Panel 1 </p>
</div>
<div class="tabs-panel" style="display:none;">
<p>Tab Panel 2</p>
</div>
<div class="tabs-panel" style="display:none;">
<p>Tab Panel 3</p>
</div>
<div class="tabs-panel" style="display:none;">
<p>Tab Panel 4 </p>
</div>
</div>
</fieldset>
<fieldset><legend>ASDUI.Tab.Class</legend>
<dl>
<dt>调用方法:</dt>
<dd>
<pre>var tab1 = new ASDUI.Tab(element,[, options]);</pre>
</dd>
<dt>一个藏袍:</dt>
<dd>
<pre>
var tab1 = new ASDUI.Tab('demo_a');
var tab2 = new ASDUI.Tab('demo_b',{closeBtn:true});
</pre>
</dd>
</dl>
<table>
<col id="middle" />
<col />
<col />
<thead>
<tr><th>Option</th>
<th>参数描述</th></tr>
</thead>
<tfoot>
</tfoot>
<tbody>
<tr><td>tabSelector</td>
<td>tab按钮的class</td>
</tr>
<tr>
<td height="44">contentSelector</td>
<td>tab内容容器的class</td>
</tr>
<tr>
<td height="44">activeClass</td>
<td>tab按钮选中时的样式</td>
</tr>
<tr>
<td height="44">tabSbox</td>
<td>动态添加按钮时放按钮的容器,当使用add()方法时不可为空。</td>
</tr>
<tr>
<td height="44">contentbox</td>
<td>动态添加内容容器时的目标容器,当使用add()方法时不可为空。</td>
</tr>
<tr>
<td height="44">addTab</td>
<td>动态添加按钮的内容,使用add()方法时有效。</td>
</tr>
<tr>
<td height="44">addContent</td>
<td>动态添加容器的内容,使用add()方法时有效。</td>
</tr>
<tr>
<td height="44">addMax</td>
<td>动态添加选项卡的最大数,默认为6</td>
</tr>
<tr>
<td height="44">closeBtn</td>
<td>是否允许关闭选项卡默认为false</td>
</tr>
<tr>
<td height="44">rel(add方法私有属性)</td>
<td>新添加选项卡的标识,不能为空且必须唯一</td>
</tr>
<tr>
<td height="44">exist</td>
<td>初始化时已经存在的选项卡个数;默认值为0;</td>
</tr>
<tr>
<td height="44">scrollTab</td>
<td>是否启用标签滚动,默认值为false</td>
</tr>
<tr>
<td height="44">step</td>
<td>标签每次滚动时的步长,默认值为200</td>
</tr>
<tr>
<td height="44">onClick(Fn)</td>
<td>选项卡点击时触发的回调函数</td>
</tr>
<tr>
<td height="44">onChange(Fn)</td>
<td>选项卡删除后触发的回调</td>
</tr>
<tr>
<td height="44"> </td>
<td> </td>
</tr>
<tr>
<td height="44"> </td>
<td> </td>
</tr>
</tbody>
</table>
<dl>
<dt>外置方法:<span>add({options});</span>新增一个选项卡</dt>
<dd>
<pre>
var tab1 = new ASDUI.Tab('demo_a',{closeBtn:true});
tab1.add({tabSbox:'myul',contentbox:'mypan',addTab:'1111111',addContent:'aaaaaaaaaaajj',rel:'123'});
</pre>
</dd>
<dt>外置方法:<span>show(index);</span>显示当前选项卡中第x个</dt>
<dd>
<pre>
var tab1 = new ASDUI.Tab('demo_a',{closeBtn:true});
tab1.show(2);
</pre>
</dd>
<dt>外置方法:<span>getIndex();</span>获取当前激活选项卡序列号</dt>
<dd>
<pre>
var tab1 = new ASDUI.Tab('demo_a',{closeBtn:true});
tab1.getIndex();
</pre>
</dd>
<dt>外置方法:<span>getSecs();</span>返回所有选项卡sec对象</dt>
<dd>
<pre>
var tab1 = new ASDUI.Tab('demo_a',{closeBtn:true});
tab1.getSecs();//return array
</pre>
</dd>
</dl>
</fieldset>
<script type="text/javascript" src="js/jquery1.91.min.js"></script>
<script src="js/asdui.js" type="text/javascript"></script>
<script type="text/javascript">
var tab1 = new ZUI.Tab('#demo_a',{
exist:4,
tabSbox:'#myul',
contentbox:'#mypan',
scrollTab:true,
dataType:'html',
onShow:function(){
//console.log(this.getSecs().eq(this.getIndex()).html())
}
});
var tab2 = new ZUI.Tab('#demo_b',{
tabSelector:'tab2',
contentSelector:'tabs-panel',
activeClass:'current',
hoverTab:true
});
Sexy = new ZUI.Box();
$(document).ready(function(){
$('#show').on('click',function(){
tab1.add({addTab:'1111111',closeBtn:true,data:'<h2>新增的选项卡1</h2>',rel:'a123'});
});
$('#show2').on('click',function(){
console.log(2);
tab1.add({addTab:'222222222',closeBtn:true,data:$('#mo').clone(),rel:'a1235'});
});
$('#showac').on('click',function(){
tab1.show(1);
});
});
</script>
</body>
</html>