在Slider Jquery中选择T​​ext field

时间:2015-02-04 19:54:06

标签: jquery forms

我正在尝试转换"选择"输入到类似于此处的滑动条但不是我试图做的无线电下降...... http://jsfiddle.net/nick_craver/KTvCV/

这是HTML

<div class="question">
    <select aria-invalid="false" class="form-control input-lg valid" name="EST_VAL" id="EST_VAL">
    <option value="77500">$75,001 - $80,000</option>
    <option value="85000">$80,001 - $85,000</option>
    <option value="90000">$85,001 - $90,000</option>
    <option value="95000">$90,001 - $95,000</option>
    <option value="100000">$95,001 - $100,000</option>
    <option value="105000">$100,001 - $105,000</option>
    <option value="110000">$105,001 - $110,000</option>
    <option value="115000">$110,001 - $115,000</option>
    <option value="120000">$115,001 - $120,000</option>
    <option value="125000">$120,001 - $125,000</option>
    <option value="130000">$125,001 - $130,000</option>
    <option value="135000">$130,001 - $135,000</option>
    <option value="140000">$135,001 - $140,000</option>
    <option value="145000">$140,001 - $145,000</option>
    <option value="150000">$145,001 - $150,000</option>
    <option value="155000">$150,001 - $155,000</option>
    <option value="160000">$155,001 - $160,000</option>
    <option value="165000">$160,001 - $165,000</option>
    <option value="170000">$165,001 - $170,000</option>
    <option value="175000">$170,001 - $175,000</option>
    <option value="180000">$175,001 - $180,000</option>
    <option value="185000">$180,001 - $185,000</option>
    <option value="195000">$190,001 - $195,000</option>
    <option value="200000">$195,001 - $200,000</option>
    <option value="205000">$200,001 - $210,000</option>
    <option value="215000" selected="selected">$210,001 - $220,000</option>
    <option value="225000">$220,001 - $230,000</option>
    <option value="245000">$240,001 - $250,000</option>
    <option value="255000">$250,001 - $260,000</option>
    <option value="265000">$260,001 - $270,000</option>
    <option value="275000">$270,001 - $280,000</option>
    <option value="285000">$280,001 - $290,000</option>
    <option value="295000">$290,001 - $300,000</option>
    <option value="305000">$300,001 - $310,000</option>
    <option value="315000">$310,001 - $320,000</option>
    <option value="325000">$320,001 - $330,000</option>
    <option value="335000">$330,001 - $340,000</option>
    <option value="345000">$340,001 - $350,000</option>
    <option value="355000">$350,001 - $360,000</option>
    <option value="365000">$360,001 - $370,000</option>
    <option value="375000">$370,001 - $380,000</option>
    <option value="385000">$380,001 - $390,000</option>
    <option value="395000">$390,001 - $400,000</option>
    <option value="410000">$400,001 - $420,000</option>
    <option value="430000">$420,001 - $440,000</option>
    <option value="450000">$440,001 - $460,000</option>
    <option value="470000">$460,001 - $480,000</option>
    <option value="490000">$480,001 - $500,000</option>
    <option value="510000">$500,001 - $520,000</option>
    <option value="530000">$520,001 - $540,000</option>
    <option value="550000">$540,001 - $560,000</option>
    <option value="570000">$560,001 - $580,000</option>
    <option value="590000">$580,001 - $600,000</option>
    <option value="610000">$600,001 - $620,000</option>
    <option value="630000">$620,001 - $640,000</option>
    <option value="650000">$640,001 - $660,000</option>
    <option value="670000">$660,001 - $680,000</option>
    <option value="690000">$680,001 - $700,000</option>
    <option value="710000">$700,001 - $720,000</option>
    <option value="730000">$720,001 - $740,000</option>
    <option value="750000">$740,001 - $760,000</option>
    <option value="770000">$760,001 - $780,000</option>
    <option value="790000">$780,001 - $800,000</option>
    <option value="810000">$800,001 - $820,000</option>
    <option value="830000">$820,001 - $840,000</option>
    <option value="850000">$840,001 - $860,000</option>
    <option value="870000">$860,001 - $880,000</option>
    <option value="890000">$880,001 - $900,000</option>
    <option value="910000">$900,001 - $920,000</option>
    <option value="930000">$920,001 - $940,000</option>
    <option value="950000">$940,001 - $960,000</option>
    <option value="970000">$960,001 - $980,000</option>
    <option value="990000">$980,001 - $1,000,000</option>
    <option value="1100000">$1,000,001 - $1,250,000</option>
    <option value="1300000">$1,250,001 - $1,500,000</option>
    <option value="1600000">$1,500,001 - $1,750,000</option>
    <option value="1800000">$1,750,001 - $2,000,000</option>
    <option value="2000001">Over $2,000,000</option>
</select>

这是代码

 $(".question").each(function() {
    var radios = $(this).find("select").hide();
    $("<div></div>").slider({
      min: parseInt(radios.first().val(), 10),
      max: parseInt(radios.last().val(), 10),
      slide: function(event, ui) {
        radios.filter("[value=" + ui.value + "]").click();
      }
    }).appendTo(this);
});

$("button").click(function() {
    alert($(":radio[name=71]:checked").val());
});

无论如何还要添加工具提示,例如 $ 75,000 - $ 80,000

0 个答案:

没有答案