Search code examples
jqueryjquery-slider

jQuery slider not sliding


Here is the code in jsfiddle

I guess there is something wrong with the slide function:

slide: function( event, ui ) {
          var input = this.next(':input');
          input.val(input.attr('alt') + ui.value);
}

Solution

  • The .next() method is a jQuery method so you need to use it in reference to a jQuery object. So just wrap this inside of a jQuery constructor.

    slide: function (event, ui) {
        var input = $(this).next(':input');
        input.val(input.attr('alt') + ui.value);
    }
    

    jsfiddle