index.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. ---
  2. layout: home
  3. title: Select2 - The jQuery replacement for select boxes
  4. slug: home
  5. ---
  6. <main class="jumbotron" role="main">
  7. <div class="container">
  8. <div class="row">
  9. <div class="col-md-6 text-center">
  10. <h1>Select2</h1>
  11. <p class="lead">
  12. The jQuery replacement for select boxes
  13. </p>
  14. </div>
  15. <div class="col-md-6 jumbotron-side text-center">
  16. <p>
  17. <a href="https://github.com/select2/select2/releases" class="btn btn-success btn-lg">
  18. <i class="fa fa-download fa-lg"></i>
  19. Download
  20. </a>
  21. </p>
  22. <p>
  23. <strong>Version</strong> 4.0.0<em>-rc.2</em>
  24. </p>
  25. </div>
  26. </div>
  27. </div>
  28. </main>
  29. <section class="notice-previous">
  30. <div class="container">
  31. <a href="http://select2.github.io/select2/">Looking for the Select2 3.5.2 docs?</a>
  32. We have moved them to a new location
  33. <a href="announcements-4.0.html">while we push forward with Select2 4.0</a>.
  34. </div>
  35. </section>
  36. <div class="container">
  37. <section id="lead" class="lead">
  38. Select2 gives you a customizable select box with support for searching,
  39. tagging, remote data sets, infinite scrolling, and many other highly used
  40. options.
  41. </section>
  42. <section id="getting-started">
  43. <h2>
  44. Getting started with Select2
  45. </h2>
  46. <p>
  47. In order to use Select2, you must include the JavaScript and CSS file on
  48. your website. You can get these files built for you from many different
  49. locations.
  50. </p>
  51. <h3>
  52. Using Select2 from a CDN
  53. </h3>
  54. <p>
  55. Select2 is hosted on both the
  56. <a href="https://cdnjs.com/libraries/select2">cdnjs</a> and
  57. <a href="http://www.jsdelivr.com/#!select2">jsDelivr</a> CDNs, allowing
  58. you to quickly include Select2 on your website.
  59. </p>
  60. <ol>
  61. <li>
  62. Include the following lines of code in the <code>&lt;head&gt;</code>
  63. section of your HTML.
  64. <pre class="code">
  65. &lt;link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.2/css/select2.min.css" rel="stylesheet" /&gt;
  66. &lt;script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.2/js/select2.min.js"&gt;&lt;/script&gt;
  67. </pre>
  68. <div class="alert alert-info">
  69. <i class="fa fa-info-circle"></i>
  70. Immediately following a new release, it takes some time for CDNs to
  71. catch up and get the new versions live on the CDN.
  72. </div>
  73. </li>
  74. <li>
  75. Initialize Select2 on the <code>&lt;select&gt;</code> element that you
  76. want to make awesome.
  77. <pre class="code">
  78. &lt;script type="text/javascript"&gt;
  79. $('select').select2();
  80. &lt;/script&gt;
  81. </pre>
  82. </li>
  83. <li>
  84. Check out the <a href="examples.html">examples page</a> to start using
  85. the additional features of Select2.
  86. </li>
  87. </ol>
  88. <h3>
  89. Downloading the code locally
  90. </h3>
  91. <p>
  92. In some situations, you can't use Select2 from a CDN and you must include
  93. the files through your own static file servers.
  94. </p>
  95. <ol>
  96. <li>
  97. <a href="https://github.com/select2/select2/tags">
  98. Download the code
  99. </a>
  100. from GitHub and copy the <code>dist</code> directory to your project.
  101. </li>
  102. <li>
  103. Include the following lines of code in the <code>&lt;head&gt;</code>
  104. section of your HTML.
  105. <pre class="code">
  106. &lt;link href="path/to/select2.min.css" rel="stylesheet" /&gt;
  107. &lt;script src="path/to/select2.min.js"&gt;&lt;/script&gt;
  108. </pre>
  109. </li>
  110. <li>
  111. Check out the <a href="examples.html">examples page</a> to start using
  112. the additional features of Select2.
  113. </li>
  114. </ol>
  115. </section>
  116. <section id="builds">
  117. <h2>
  118. The different Select2 builds
  119. </h2>
  120. <p>
  121. Select2 provides multiple builds that are tailored to different
  122. environments where it is going to be used. If you think you need to use
  123. Select2 in a nonstandard environment, like when you are using AMD, you
  124. should read over the list below.
  125. </p>
  126. <table class="table table-bordered table-striped">
  127. <thead>
  128. <tr>
  129. <th>Build name</th>
  130. <th>When you should use it</th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. <tr id="builds-standard">
  135. <td>
  136. Standard (<code>select2.js</code> / <code>select2.min.js</code>)
  137. </td>
  138. <td>
  139. This is the build that most people should be using for Select2. It
  140. includes the most commonly used features.
  141. </td>
  142. </tr>
  143. <tr id="builds-full">
  144. <td>
  145. Full (<code>select2.full.js</code> / <code>select2.full.min.js</code>)
  146. </td>
  147. <td>
  148. You should only use this build if you need the additional features
  149. from Select2, like the
  150. <a href="options.html#compatibility">compatibility modules</a> or
  151. recommended includes like
  152. <a href="https://github.com/jquery/jquery-mousewheel">jquery.mousewheel</a>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. </section>
  158. <section id="about">
  159. <h2>
  160. About
  161. </h2>
  162. <ul>
  163. <li>
  164. <a href="https://github.com/select2/select2">
  165. Source code, hosted on GitHub
  166. </a>
  167. </li>
  168. <li>
  169. <a href="https://github.com/select2/select2/issues">
  170. Bug tracker
  171. </a>
  172. </li>
  173. <li>
  174. <a href="community.html">
  175. Community and support
  176. </a>
  177. </li>
  178. </ul>
  179. </section>
  180. </div>