JqueryUI - The Selectmenu widgets provides a styleable select element replacement.


SUBMITTED BY: jlolk3r

DATE: Feb. 18, 2016, 1:26 a.m.

FORMAT: HTML

SIZE: 2.5 kB

HITS: 1317

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>jQuery UI Selectmenu - Default functionality</title>
  7. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  8. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  9. <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  10. <link rel="stylesheet" href="/resources/demos/style.css">
  11. <script>
  12. $(function() {
  13. $( "#speed" ).selectmenu();
  14. $( "#files" ).selectmenu();
  15. $( "#number" )
  16. .selectmenu()
  17. .selectmenu( "menuWidget" )
  18. .addClass( "overflow" );
  19. });
  20. </script>
  21. <style>
  22. fieldset {
  23. border: 0;
  24. }
  25. label {
  26. display: block;
  27. margin: 30px 0 0 0;
  28. }
  29. select {
  30. width: 200px;
  31. }
  32. .overflow {
  33. height: 200px;
  34. }
  35. </style>
  36. </head>
  37. <body>
  38. <div class="demo">
  39. <form action="#">
  40. <fieldset>
  41. <label for="speed">Select a speed</label>
  42. <select name="speed" id="speed">
  43. <option>Slower</option>
  44. <option>Slow</option>
  45. <option selected="selected">Medium</option>
  46. <option>Fast</option>
  47. <option>Faster</option>
  48. </select>
  49. <label for="files">Select a file</label>
  50. <select name="files" id="files">
  51. <optgroup label="Scripts">
  52. <option value="jquery">jQuery.js</option>
  53. <option value="jqueryui">ui.jQuery.js</option>
  54. </optgroup>
  55. <optgroup label="Other files">
  56. <option value="somefile">Some unknown file</option>
  57. <option value="someotherfile">Some other file with a very long option text</option>
  58. </optgroup>
  59. </select>
  60. <label for="number">Select a number</label>
  61. <select name="number" id="number">
  62. <option>1</option>
  63. <option selected="selected">2</option>
  64. <option>3</option>
  65. <option>4</option>
  66. <option>5</option>
  67. <option>6</option>
  68. <option>7</option>
  69. <option>8</option>
  70. <option>9</option>
  71. <option>10</option>
  72. <option>11</option>
  73. <option>12</option>
  74. <option>13</option>
  75. <option>14</option>
  76. <option>15</option>
  77. <option>16</option>
  78. <option>17</option>
  79. <option>18</option>
  80. <option>19</option>
  81. </select>
  82. </fieldset>
  83. </form>
  84. </div>
  85. </body>
  86. </html>

comments powered by Disqus