forked from shihao316558512/bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.html
464 lines (463 loc) · 25.4 KB
/
form.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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="favicon.ico" />
<!--jquery库-->
<script src="js/jquery.min.js"></script>
<!--bootstrap库-->
<link href="css/bootstrap.min.css" rel="stylesheet" />
<script src="js/bootstrap/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="js/bootstrap/html5shiv.min.js"></script>
<script src="js/bootstrap/respond.min.js"></script>
<![endif]-->
<!--font-awesome字体库-->
<link href="css/font-awesome.min.css" rel="stylesheet" />
<!--页面加载进度条-->
<link href="css/pace/dataurl.css" rel="stylesheet" />
<script src="js/pace/pace.min.js"></script>
<!--平滑滚动到顶部库-->
<script src="js/jquery.scrolltopcontrol/scrolltopcontrol.js" type="text/javascript"></script>
<!--主要写的jquery拓展方法-->
<script src="js/jquery.extend.js" type="text/javascript"></script>
<!--主要写的css代码-->
<link href="css/default.css" rel="stylesheet" type="text/css" />
<!--主要写的js代码-->
<script src="js/default.js" type="text/javascript"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle show pull-left" data-target="sidebar">
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</button>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Bootstrap</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="top1.html">top1.html</a></li>
<li><a href="top2.html">top2.html</a></li>
<li><a href="top3.html">top3.html</a></li>
<li><a href="https://github.com/shihao316558512/bootstrap" target="_blank"><i class="fa fa-download fa-fw"></i> 原码下载</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
aria-expanded="false"><i class="fa fa-user fa-fw"></i> 小王 <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="top-right1.html">top-right1.html</a></li>
<li class="divider"></li>
<li><a href="top-right2.html">top-right2.html</a></li>
<li class="divider"></li>
<li><a href="top-right3.html"><i class="fa fa-sign-out fa-fw"></i> top-right3.html</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid all">
<div class="sidebar">
<ul class="nav">
<li><a href="index.html">主页面</a></li>
<li><a href="form.html">Form库</a></li>
<li><a href="message.html">Message库</a></li>
<li><a href="ui.html">UI库</a></li>
<li><a href="animate.html">Animate库</a></li>
<li><a href="carousel.html">Carousel库</a></li>
<li><a href="chart.html">Chart库</a></li>
<li class="has-sub">
<a href="javascript:void(0);"><span>导航选中演示</span><i class="fa fa-caret-right fa-fw pull-right"></i></a>
<ul class="sub-menu">
<li><a href="left1.html"><i class="fa fa-circle-o fa-fw"></i> left1</a></li>
<li><a href="left2.html"><i class="fa fa-circle-o fa-fw"></i> left2</a></li>
<li><a href="left3.html"><i class="fa fa-circle-o fa-fw"></i> left3及子页面</a></li>
</ul>
</li>
</ul>
</div>
<div class="maincontent row form-horizontal">
<!--我是主要内容 start-->
<ul class="breadcrumb">
<li class="active">Form库</li>
</ul>
<div class="col-sm-12">
<!--日期选择插件data-picker start-->
<div class="row" id="form-datepicker">
<div class="page-header text-center">
<h2>bootstrap日期选择插件</h2>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">插件名</label>
<div class="col-sm-10">
<p class="form-control-static">
bootstrap-datepicker
</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">官网</label>
<div class="col-sm-10">
<a href="http://eternicode.github.io/bootstrap-datepicker/" class="btn btn-info" target="_blank">http://eternicode.github.io/bootstrap-datepicker/</a>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">特殊说明</label>
<div class="col-sm-11">
<p class="form-control-static">
该插件依赖bootstrap库
</p>
<p class="form-control-static">
如果弹框的位置有偏差,则可以做略微的调整就行。例如:父级margin-top:50px;,则设置.datepicker { margin-top: 50px; }
</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<link href="css/bootstrap.datepicker/bootstrap-datepicker3.min.css" rel="stylesheet" />
<script src="js/bootstrap.datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="js/bootstrap.datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script src="js/bootstrap.datepicker/locales/bootstrap-datepicker.ja.min.js"></script>
<style>
/*注意:如果位置有偏差,则做相应的调整*/
.datepicker { margin-top: 50px; }
</style>
<script type="text/javascript">
$(function () {
$('.sandbox-container:eq(0) input').datepicker({
format: "yyyy/mm/dd",
language: "zh-CN"
});
$('.sandbox-container:eq(1) .input-group.date').datepicker({
format: "yyyy/mm/dd",
language: "ja"
});
$('.sandbox-container:eq(2) .input-daterange').datepicker({
format: "yyyy/mm/dd"
});
})
</script>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">中文效果</label>
<div class="col-sm-11 sandbox-container">
<input type="text" class="form-control">
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">日文效果</label>
<div class="col-sm-11 sandbox-container">
<div class="input-group date">
<input type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">范围效果</label>
<div class="col-sm-11 sandbox-container">
<div class="input-daterange input-group">
<input type="text" class="form-control" name="start" />
<span class="input-group-addon">to</span>
<input type="text" class="form-control" name="end" />
</div>
</div>
</div>
</div>
</div>
<!--日期选择插件data-picker end-->
<!--日期及时间范围选择插件DateRangePicker start-->
<div class="row" id="form-DateRangePicker">
<div class="page-header text-center">
<h2>bootstrap日期及时间范围选择插件</h2>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">插件名</label>
<div class="col-sm-10">
<p class="form-control-static">
Bootstrap Date Range Picker
</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">官网</label>
<div class="col-sm-10">
<a href="http://www.daterangepicker.com/" class="btn btn-info" target="_blank">http://www.daterangepicker.com/</a>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">特殊说明</label>
<div class="col-sm-11">
<p class="form-control-static">该插件依赖bootstrap库和font-awesome库</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<link href="css/bootstrap.DateRangePicker/daterangepicker.css" rel="stylesheet" />
<!--引用多语言版本-->
<script src="js/bootstrap.DateRangePicker/moment-with-locales.min.js"></script>
<script src="js/bootstrap.DateRangePicker/daterangepicker.js"></script>
<script type="text/javascript">
$(function () {
$('#tbTime').daterangepicker({
timePicker: true,
timePickerIncrement: 1,
locale: {
format: 'YYYY/MM/DD hh:mm:ss'
},
startDate: $("#lbStartTime").html(),
endDate: $("#lbEndTime").html()
}, function (start, end, label) {
$("#lbStartTime").html(start.format('YYYY/MM/DD hh:mm:ss'));
$("#lbEndTime").html(end.format('YYYY/MM/DD hh:mm:ss'));
});
//对中文的支持
$('#tbTime').data('daterangepicker').updateMomentLocale('zh-cn');
});
</script>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">使用效果</label>
<div class="col-sm-10">
<input type="text" id="tbTime" class="form-control" />
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">结果</label>
<div class="col-sm-10">
<p class="form-control-static">
<label class="label label-danger" id="lbStartTime">2016/04/19</label>
<label class="label label-danger" id="lbEndTime">2016/05/19</label>
</p>
</div>
</div>
</div>
</div>
<!--日期及时间范围范围选择插件DateRangePicker end-->
<!--日期时间选择插件datetimepicker start-->
<div class="row" id="form-datetimepicker">
<div class="page-header text-center">
<h2>bootstrap日期时间选择插件</h2>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">插件名</label>
<div class="col-sm-10">
<p class="form-control-static">
Bootstrap 3 Datepicker
</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">官网</label>
<div class="col-sm-10">
<a href="http://eonasdan.github.io/bootstrap-datetimepicker/" class="btn btn-info" target="_blank">http://eonasdan.github.io/bootstrap-datetimepicker/</a>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">特殊说明</label>
<div class="col-sm-11">
<p class="form-control-static">
该插件依赖bootstrap库
</p>
<p class="form-control-static">
部分涉及时间格式的功能依赖moment.js
</p>
<p class="form-control-static">
多说一句:moment-with-locales.min.js支持中文了,详细信息参考官网
</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<link href="css/bootstrap.datetimepicker/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="js/bootstrap.datetimepicker/bootstrap-datetimepicker.min.js"></script>
<style>
/*这里为了解决上面插件定义的样式污染的问题*/
#form-datetimepicker .datepicker { margin-top: auto; }
</style>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker();
//这里的函数用到了moment.js,因为前面插件已经引用进去了,所以不再引用。
//否则是需要引用moment.js的。
$('#datetimepicker3').datetimepicker({
format: 'LT'
});
});
</script>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">使用效果</label>
<div class="col-sm-10">
<div class="col-sm-6">
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<div class='input-group date' id='datetimepicker3'>
<input type='text' class="form-control" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--日期时间选择插件datetimepicker end-->
<!--选色插件colorpicker start-->
<div class="row" id="form-colorpicker">
<div class="page-header text-center">
<h2>bootstrap选色插件</h2>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">插件名</label>
<div class="col-sm-10">
<p class="form-control-static">
Bootstrap Colorpicker
</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">官网</label>
<div class="col-sm-10">
<a href="https://mjolnic.com/bootstrap-colorpicker/" class="btn btn-info" target="_blank">https://mjolnic.com/bootstrap-colorpicker/</a>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">特殊说明</label>
<div class="col-sm-11">
<p class="form-control-static">该插件依赖bootstrap库</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<link href="css/bootstrap.colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet" />
<script src="js/bootstrap.colorpicker/bootstrap-colorpicker.min.js"></script>
<script>
$(function () {
$('#cp2').colorpicker({
format: "hex"
});
});
</script>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">使用效果</label>
<div class="col-sm-10">
<div id="cp2" class="input-group colorpicker-component">
<input type="text" value="#00AABB" class="form-control" />
<span class="input-group-addon"><i></i></span>
</div>
</div>
</div>
</div>
</div>
<!--选择插件colorpicker end-->
<!--formhelper start-->
<div class="row" id="form-formhelper">
<div class="page-header text-center">
<h2>Bootstrap Form Helper 插件集合</h2>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">插件名</label>
<div class="col-sm-10">
<p class="form-control-static">
Bootstrap Form Helper
</p>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">官网</label>
<div class="col-sm-10">
<a href="http://bootstrapformhelpers.com/" class="btn btn-info" target="_blank">http://bootstrapformhelpers.com/</a>
</div>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="inputEmail3" class="col-sm-1 control-label">特殊说明</label>
<div class="col-sm-11">
<p class="form-control-static">该插件依赖bootstrap库</p>
<p class="form-control-static">注意:Number Input使用的时候必须放在form中才能初始化,如果页面没有form,则没法初始化插件(也就是看着没效果)</p>
</div>
</div>
</div>
<div class="clearfix"></div>
<link href="css/bootstrap.formhelper/css/bootstrap-formhelpers.min.css" rel="stylesheet" />
<script src="js/bootstrap.formhelper/bootstrap-formhelpers.min.js"></script>
<div class="col-sm-6">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">使用效果</label>
<div class="col-sm-10">
<div class="row">
<div class="col-sm-6">
<div class="bfh-timepicker">
</div>
</div>
<div class="col-sm-6">
<form>
<input type="text" class="form-control bfh-number" value='0'>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!--formhelper end-->
</div>
<!--我是主要内容 end-->
</div>
</div>
<a href="#top" id="goTop"><i class="fa fa-angle-up fa-3x"></i></a>
<a href="https://github.com/shihao316558512">
<img class="forkme" src="image/forkme.png" alt="Fork me on GitHub">
</a>
</body>
</html>