1

Im a little stuck and wondering if anyone can spot why? its actually not generating the sliders at all so a little lost.

JSFiddle here: 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);
            },
        });
    });
});
1
  • what is this? value: value: jQuery('.scoreID').val(), Commented Jun 21, 2013 at 10:39

1 Answer 1

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/

To Get Values on textbox, do like this:

slide: function(event, ui) {
            $(this).parent().find('.scoreID').val(ui.value);
 }
Sign up to request clarification or add additional context in comments.

2 Comments

Maybe i got it a little wrong, the slider is meant to be under the input? but seems its not.
i have updated here again: jsfiddle.net/DmDkp/5 and change slider to change but not updating value, can you see why?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.