2013-06-21 21 views
1

我有点卡住了,想知道是否有人可以发现为什么?它实际上并没有产生滑块,所以有点失落。多个输入不工作的jQuery UI滑块

的jsfiddle这里:http://jsfiddle.net/DmDkp/

HTML

<div class="markup scoreSlide"> 
    <input type="text" id="" class="scoreID" value="" /> 
    <div class="scoreSlider"></div> 
</div> 

<div class="markup scoreSlide"> 
    <input type="text" id="" class="scoreID" value="" /> 
    <div class="scoreSlider"></div> 
</div> 

<div class="markup scoreSlide"> 
    <input type="text" id="" class="scoreID" value="" /> 
    <div class="scoreSlider"></div> 
</div> 

JS

jQuery(document).ready(function() { 
    jQuery('.scoreSlide').each(function(){ 
     jQuery(this).find('.scoreID').slider({ 
      animate: true, 
      range: "min", 
      value: value: jQuery('.scoreID').val(), 
      min: 1, 
      max: 5, 
      step: 1, 
      slide: function(event, ui) { 
      jQuery(this).find('.scoreSlider').html(ui.value); 
      }, 
     }); 
    }); 
}); 
+0

这是什么? 'value:value:jQuery('。scoreID')。val(),' –

回答

1
jQuery(this).find('.scoreSlider').slider({ 
      animate: true, 
      range: "min", 
      value: jQuery('.scoreSlider').val(), 
      min: 1, 
      max: 5, 
      step: 1, 
      slide: function(event, ui) { 
      jQuery(this).find('.scoreID').html(ui.value); 
      }, 
     }); 

DEMO -- >http://jsfiddle.net/DmDkp/8/

要在文本框上获取值,请执行下列操作:

slide: function(event, ui) { 
      $(this).parent().find('.scoreID').val(ui.value); 
} 
+0

也许我知道它有点不对,滑块意味着在输入?但似乎没有。 – 1Line

+0

请参阅http://jsfiddle.net/DmDkp/3/ –

+0

我在此处再次更新:http://jsfiddle.net/DmDkp/5/并更改滑块以更改但不更新值,您能看到为什么吗? – 1Line