corrade-http-templates – Blame information for rev 57
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
57 | office | 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 Slider - Slider bound to select</title> |
||
7 | <link rel="stylesheet" href="../../themes/base/all.css"> |
||
8 | <link rel="stylesheet" href="../demos.css"> |
||
9 | <script src="../../external/requirejs/require.js"></script> |
||
10 | <script src="../bootstrap.js"> |
||
11 | var select = $( "#minbeds" ); |
||
12 | var slider = $( "<div id='slider'></div>" ).insertAfter( select ).slider({ |
||
13 | min: 1, |
||
14 | max: 6, |
||
15 | range: "min", |
||
16 | value: select[ 0 ].selectedIndex + 1, |
||
17 | slide: function( event, ui ) { |
||
18 | select[ 0 ].selectedIndex = ui.value - 1; |
||
19 | } |
||
20 | }); |
||
21 | $( "#minbeds" ).on( "change", function() { |
||
22 | slider.slider( "value", this.selectedIndex + 1 ); |
||
23 | }); |
||
24 | </script> |
||
25 | </head> |
||
26 | <body> |
||
27 | |||
28 | <form id="reservation"> |
||
29 | <label for="minbeds">Minimum number of beds</label> |
||
30 | <select name="minbeds" id="minbeds"> |
||
31 | <option>1</option> |
||
32 | <option>2</option> |
||
33 | <option>3</option> |
||
34 | <option>4</option> |
||
35 | <option>5</option> |
||
36 | <option>6</option> |
||
37 | </select> |
||
38 | </form> |
||
39 | |||
40 | <div class="demo-description"> |
||
41 | <p>How to bind a slider to an existing select element. The select stays visible to display the change. When the select is changed, the slider is updated, too.</p> |
||
42 | </div> |
||
43 | </body> |
||
44 | </html> |