Trigger a jQuery UI slider event

前端 未结 12 2090
南方客
南方客 2020-12-02 22:04

How can I trigger a change event on a jQuery UI slider?

I thought it would be

$(\'#slider\').trigger(\'slidechange\');

but that do

12条回答
  •  日久生厌
    2020-12-02 22:42

    I found it easier to use the 'create' method to call the slide or stop function. Eg, for a slider with a min/max range:

    $('#height').slider({
            ...
            create: function(event, slider){ $( "#height" ).slider( "option", "values", [1100, 1500] ); handleHeightSlide('slide', $( "#height" ));},
            ...
        });
    

提交回复
热议问题