index.html 3.7 KB

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