forked from select2/select2.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
237 lines (209 loc) · 6.55 KB
/
index.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
---
layout: home
title: Select2 - The jQuery replacement for select boxes
slug: home
---
<main class="jumbotron" role="main">
<div class="container text-center">
<h1>Select2</h1>
<p class="lead">
The jQuery replacement for select boxes
</p>
<p>
<a href="https://github.com/select2/select2/releases" class="btn btn-outline-inverse btn-lg">
Download Select2
</a>
</p>
<p class="version">
Currently v4.0.3</a>
</p>
</div>
</main>
{% include notice-previous.html %}
<div class="container">
<section id="lead" class="lead">
Select2 gives you a customizable select box with support for searching,
tagging, remote data sets, infinite scrolling, and many other highly used
options.
</section>
<hr class="half-rule">
<div class="s2-docs-featurette">
<div class="row">
<div class="col-sm-4">
<i class="fa fa-language"></i>
<h4>In your language</h4>
<p>
Select2 comes with support for
<a href="examples.html#rtl">RTL environments</a>,
<a href="examples.html#diacritics">searching with diacritics</a> and
<a href="examples.html#language">over 40 languages</a> built-in.
</p>
</div>
<div class="col-sm-4">
<i class="fa fa-database"></i>
<h4>Remote data support</h4>
<p>
<a href="examples.html#data-ajax">Using AJAX</a> you can efficiently
search large lists of items.
</p>
</div>
<div class="col-sm-4">
<i class="fa fa-paint-brush"></i>
<h4>Fits in with your theme</h4>
<p>
Fully skinnable, CSS built with Sass and an
<a href="https://github.com/select2/select2-bootstrap-theme">optional theme for Bootstrap 3</a>.
</p>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<i class="fa fa-plug"></i>
<h4>Fully extensible</h4>
<p>
The <a href="announcements-4.0.html#plugin-system">plugin system</a>
allows you to easily customize Select2 to work exactly how you want it
to.
</p>
</div>
<div class="col-sm-4">
<i class="fa fa-tag"></i>
<h4>Dynamic item creation</h4>
<p>
Allow users to type in a new option and
<a href="examples.html#tags">add it on the fly</a>.
</p>
</div>
<div class="col-sm-4">
<i class="fa fa-html5"></i>
<h4>Full browser support</h4>
<p>Support for both modern and legacy browsers is built-in, even including Internet Explorer 8.</p>
</div>
</div>
</div>
<hr class="half-rule">
<section id="getting-started">
<h2>
Getting started with Select2
</h2>
<p>
In order to use Select2, you must include the JavaScript and CSS file on
your website. You can get these files built for you from many different
locations.
</p>
<h3>
Using Select2 from a CDN
</h3>
<p>
Select2 is hosted on both the
<a href="https://cdnjs.com/libraries/select2">cdnjs</a> and
<a href="https://www.jsdelivr.com/#!select2">jsDelivr</a> CDNs, allowing
you to quickly include Select2 on your website.
</p>
<ol>
<li>
<p>
Include the following lines of code in the <code><head></code>
section of your HTML.
</p>
{% highlight html %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
{% endhighlight %}
<div class="alert alert-info">
<i class="fa fa-info-circle"></i>
Immediately following a new release, it takes some time for CDNs to
catch up and get the new versions live on the CDN.
</div>
</li>
<li>
<p>
Initialize Select2 on the <code><select></code> element that you
want to make awesome.
</p>
{% highlight html %}
<script type="text/javascript">
$('select').select2();
</script>
{% endhighlight %}
</li>
<li>
Check out the <a href="examples.html">examples page</a> to start using
the additional features of Select2.
</li>
</ol>
<h3>
Downloading the code locally
</h3>
<p>
In some situations, you can't use Select2 from a CDN and you must include
the files through your own static file servers.
</p>
<ol>
<li>
<p>
<a href="https://github.com/select2/select2/tags">
Download the code
</a>
from GitHub and copy the <code>dist</code> directory to your project.
</p>
</li>
<li>
<p>
Include the following lines of code in the <code><head></code>
section of your HTML.
</p>
{% highlight html %}
<link href="path/to/select2.min.css" rel="stylesheet" />
<script src="path/to/select2.min.js"></script>
{% endhighlight %}
</li>
<li>
Check out the <a href="examples.html">examples page</a> to start using
the additional features of Select2.
</li>
</ol>
</section>
<section id="builds">
<h2>
The different Select2 builds
</h2>
<p>
Select2 provides multiple builds that are tailored to different
environments where it is going to be used. If you think you need to use
Select2 in a nonstandard environment, like when you are using AMD, you
should read over the list below.
</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Build name</th>
<th>When you should use it</th>
</tr>
</thead>
<tbody>
<tr id="builds-standard">
<td>
Standard (<code>select2.js</code> / <code>select2.min.js</code>)
</td>
<td>
This is the build that most people should be using for Select2. It
includes the most commonly used features.
</td>
</tr>
<tr id="builds-full">
<td>
Full (<code>select2.full.js</code> / <code>select2.full.min.js</code>)
</td>
<td>
You should only use this build if you need the additional features
from Select2, like the
<a href="options.html#compatibility">compatibility modules</a> or
recommended includes like
<a href="https://github.com/jquery/jquery-mousewheel">jquery.mousewheel</a>
</td>
</tr>
</tbody>
</table>
</section>
</div>