index.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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">
  16. <p>
  17. <a href="announcements-4.0.html" 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>beta</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 while we work on Select2 4.0.
  33. </div>
  34. </section>
  35. <div class="container">
  36. <section id="lead" class="lead">
  37. Select2 gives you a customizable select box with support for searching,
  38. tagging, remote data sets, infinite scrolling, and many other highly used
  39. options.
  40. </section>
  41. <section id="getting-started">
  42. <h2>
  43. Getting started with Select2
  44. </h2>
  45. <p>
  46. In order to use Select2, you must include the JavaScript and CSS file on
  47. your website. You can get these files built for you from many different
  48. locations.
  49. </p>
  50. <h3>
  51. Using Select2 from a CDN
  52. </h3>
  53. <p>
  54. Select2 is hosted on both the
  55. <a href="https://cdnjs.com/libraries/select2">cdnjs</a> and
  56. <a href="http://www.jsdelivr.com/#!select2">jsDelivr</a> CDNs, allowing
  57. you to quickly include Select2 on your website.
  58. </p>
  59. <ol>
  60. <li>
  61. Include the following lines of code in the <code>&lt;head&gt;</code>
  62. section of your HTML.
  63. <pre class="code">
  64. &lt;link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/select2.min.css" /&gt;
  65. &lt;script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/select2.min.js"&gt;&lt;/script&gt;
  66. </pre>
  67. <div class="alert alert-info">
  68. <i class="fa fa-info-circle"></i>
  69. Immediately following a new release, it takes some time for CDNs to
  70. catch up and get the new versions live on the CDN.
  71. </div>
  72. </li>
  73. <li>
  74. Initialize Select2 on the <code>&gt;select&lt;</code> element that you
  75. want to make awesome.
  76. <pre class="code">
  77. &lt;script type="text/javascript"&gt;
  78. $('select').select2();
  79. &lt;/script&gt;
  80. </pre>
  81. </li>
  82. <li>
  83. Check out the <a href="examples.html">examples page</a> to start using
  84. the additional features of Select2.
  85. </li>
  86. </ol>
  87. <h3>
  88. Downloading the code locally
  89. </h3>
  90. <p>
  91. In some situations, you can't use Select2 from a CDN and you must include
  92. the files through your own static file servers.
  93. </p>
  94. <ol>
  95. <li>
  96. <a href="https://github.com/select2/select2/tags">
  97. Download the code
  98. </a>
  99. from GitHub and copy the <code>dist</code> directory to your project.
  100. </li>
  101. <li>
  102. Include the following lines of code in the <code>&lt;head&gt;</code>
  103. section of your HTML.
  104. <pre class="code">
  105. &lt;link href="path/to/select2.min.css" /&gt;
  106. &lt;script src="path/to/select2.js"&gt;&lt;/script&gt;
  107. </pre>
  108. </li>
  109. <li>
  110. Check out the <a href="examples.html">examples page</a> to start using
  111. the additional features of Select2.
  112. </li>
  113. </ol>
  114. </section>
  115. <section id="about">
  116. <h2>
  117. About
  118. </h2>
  119. <ul>
  120. <li>
  121. <a href="https://github.com/select2/select2">
  122. Source code, hosted on GitHub
  123. </a>
  124. </li>
  125. <li>
  126. <a href="https://github.com/select2/select2/issues">
  127. Bug tracker
  128. </a>
  129. </li>
  130. <li>
  131. <a href="community.html">
  132. Community and support
  133. </a>
  134. </li>
  135. </ul>
  136. </section>
  137. </div>