author | ymh <ymh.work@gmail.com> |
Sat, 12 Jun 2010 00:33:37 +0200 | |
changeset 30 | 81d408373dde |
permissions | -rw-r--r-- |
30
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
<!DOCTYPE html> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
<html lang="en"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
<head> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
<meta charset="UTF-8" /> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
<title>jQuery UI Slider - Range with fixed minimum</title> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
<script type="text/javascript" src="../../jquery-1.4.2.js"></script> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
<script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
<script type="text/javascript" src="../../ui/jquery.ui.slider.js"></script> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
<link type="text/css" href="../demos.css" rel="stylesheet" /> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
<style type="text/css"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
#demo-frame > div.demo { padding: 10px !important; }; |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
</style> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
<script type="text/javascript"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
$(function() { |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
var select = $("#minbeds"); |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
var slider = $('<div id="slider"></div>').insertAfter(select).slider({ |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
min: 1, |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
max: 6, |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
range: "min", |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
value: select[0].selectedIndex + 1, |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
slide: function(event, ui) { |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
select[0].selectedIndex = ui.value - 1; |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
} |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
}); |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
$("#minbeds").click(function() { |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
slider.slider("value", this.selectedIndex + 1); |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
}); |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
}); |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
</script> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
</head> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
<body> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
<div class="demo"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
<form id="reservation"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
<label for="minbeds">Minimum number of beds</label> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
<select name="minbeds" id="minbeds"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
<option>1</option> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
<option>2</option> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
<option>3</option> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
<option>4</option> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
<option>5</option> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
<option>6</option> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
</select> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
</form> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
</div><!-- End demo --> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
<div class="demo-description"> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
<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> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
</div><!-- End demo-description --> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
|
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
</body> |
81d408373dde
itry to have the player in the preview page
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
</html> |