-
Notifications
You must be signed in to change notification settings - Fork 3
/
select搜索选择.html
45 lines (45 loc) · 1.57 KB
/
select搜索选择.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="./source/jquery-3.1.0.js"></script>
<script src="./source/select2.full.js"></script>
<link rel="stylesheet" href="./source/select2.css" />
<style>
.select2-container .select2-results {max-height: 300px;}
</style>
</head>
<body>
<a href="https://select2.github.io/">官方文档</a>
<a href="https://github.com/select2/select2">github链接</a>
<h1>最基础的选择</h1>
<select class="basic" style="width:100%;">
<option value="姓名">姓名</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="性别">性别</option>
<option value="username">用户名</option>
</select>
<script>
$(".basic").select2({
minimumResultsForSearch: Infinity,
dropdownCssClass: 'bigdrop',
// templateSelection: function(args) {
// return args.element
// return args;
// },
});
</script>
<h1>使用服务器配合的选择</h1>
<a href="http://www.ramwin.com/testjs/select2/">需要后台配合</a>
</body>
</html>