使用jQuery ui滑块和单选按钮执行计算

时间:2012-11-30 13:35:36

标签: radio-button jquery-ui-slider

我想在http://www.andyloos.co.uk/calculator/上复制计算器。是否有可能看到他们如何进行计算?要查看他们的Java脚本吗?

我已经达到了http://jsfiddle.net/jstyl_es/Sqsuu/,但我并不太了解Java-Script以便将其推向前进。有人可以帮忙吗?

<div id="slider1"></div>

<div id="slider2"></div>

<div id="option">
  <input type="radio"  name="timeselect" value="optionA" />
  Less than 6 hours
  <input type="radio"  name="timeselect" value="optionB" />
  More than 6 hours
</div>

<input class="submit" type="submit" name="submit" value="Estimate">        

</div>



`$(function() {
  $( "#slider1" ).slider({
    value:0,
    min: 0,
    max: 100000,
    step: 50,
    slide: function( event, ui ) {
      $( "#amount1" ).val( ui.value );
    }
  });
  $( "#amount1" ).val($( "#slider1" ).slider( "value" ) );
});

$(function() {
  $( "#slider2" ).slider({
    value:0,
    min: 0,
    max: 100000,
    step: 50,
    slide: function( event, ui ) {
      $( "#amount2" ).val( ui.value );
    }
  });
  $( "#amount2" ).val($( "#slider2" ).slider( "value" ) );
});

0 个答案:

没有答案