質問編集履歴

1

現在のソースコードを追加しました。最初は500の幅で動かし、途中から1000単位でつまみを動かしたいです。

2018/06/26 04:23

投稿

ar_
ar_

スコア11

test CHANGED
File without changes
test CHANGED
@@ -65,3 +65,103 @@
65
65
  0→50→100→150のような動きになってしまいます。
66
66
 
67
67
  そもそも途中で値を変更させる場合stepは使わないのでしょうか?
68
+
69
+
70
+
71
+
72
+
73
+ ### 現在のソースコード
74
+
75
+
76
+
77
+ ```
78
+
79
+ <html lang="en">
80
+
81
+
82
+
83
+ <head>
84
+
85
+ <meta charset="utf-8">
86
+
87
+ <meta name="viewport" content="width=device-width, initial-scale=1">
88
+
89
+ <title>jQuery UI Slider - Range slider</title>
90
+
91
+ <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
92
+
93
+ <link rel="stylesheet" href="/resources/demos/style.css">
94
+
95
+ <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
96
+
97
+ <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
98
+
99
+ </head>
100
+
101
+ <body>
102
+
103
+ <script type="text/javascript">
104
+
105
+ jQuery(function() {
106
+
107
+ jQuery('#PriceRangeslider').slider({
108
+
109
+ min: 0,
110
+
111
+ max: 100000,
112
+
113
+ step: 500,
114
+
115
+ range: true,
116
+
117
+ values: [0, 100000],
118
+
119
+ slide: function(e, ui) {
120
+
121
+ jQuery('#PriceMin').val(ui.values[0]);
122
+
123
+ jQuery('#PriceMax').val(ui.values[1]);
124
+
125
+ },
126
+
127
+ change: function(e, ui) {
128
+
129
+ jQuery('#PriceMin').val(ui.values[0]);
130
+
131
+ jQuery('#PriceMax').val(ui.values[1]);
132
+
133
+ },
134
+
135
+ create: function(e, ui) {
136
+
137
+ var values = jQuery(this).slider('option', 'values')
138
+
139
+ jQuery('#PriceMin').val(values[0]);
140
+
141
+ jQuery('#PriceMax').val(values[1]);
142
+
143
+ }
144
+
145
+ });
146
+
147
+ });
148
+
149
+ </script>
150
+
151
+ <form action="" method="" name="">
152
+
153
+ <input id="PriceMin" class="min_price_" type="text" />〜
154
+
155
+ <input id="PriceMax" class="max_price_" type="text" />
156
+
157
+ <div id="PriceRangeslider" class="range_slider_" style="width:180px;"></div>
158
+
159
+ </form>
160
+
161
+ </body>
162
+
163
+
164
+
165
+ </html>
166
+
167
+ ```