Call slider slide method - jQuery Ui

Asked

Viewed 40 times

0

How do I call the method slide ?

$("#slider-range-min-idle_timeout" ).slider({
      range: "min",
      min: 10,
      max: 60,
      step:10,
      slide: function( event, ui ) {

        $("input:text#idle_timeout").val(ui.value+" minutos");
        $("input:hidden[name=idle_timeout]").val(ui.value*60);
      }
    });

1 answer

0

From what it says in the documentation:

Triggered in each mouse movement during slide. The given value in case as ui.value represents the value the handle will have as a result of the current movement. Canceling the event will prevent the handle from moving and the handle will continue to have its previous value.

This event is called on each slide move. Try giving a console.log(Event, ui) inside the function to see if it is returning something or if the error.

See here the Documentation of the slider

  • The plugin is working perfectly but as you can see I do the data processing before populating them in the fields so not to rewrite the code I would just call the event at the time of popular. for it to format values.

  • Now I understand what you need. There’s a way to call Rigger, but I can’t test now. Check it out and tell me if it worked: $slider = $('#slider-range-min-idle_timeout'); $slider.slider('option', 'slide'). call($slider);

  • Made a mistake Uncaught TypeError: Cannot read property 'value' of undefined he probably doesn’t get the parameter ui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.