📜  jquery 滑块获取更改值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.747000             🧑  作者: Mango

代码示例1
$(function() {
  $( "#slider" ).slider({
  range:"min",
  min: 0,
  max: 100,
  value: 10,
  slide: function wynik( event, ui ) {
     $( "#price" ).val("$" + ui.value);
  }
  });
  $( "#price" ).val( "$" + $( "#slider" ).slider( "value") );
    var val = $('#slider').slider("value");
    if ( val >= 20 ) {
       $("#priceText").text("first text");
    } else {
       $("#priceText").text("second text");
    }
});