Trigger a jQuery UI slider event

前端 未结 12 2096
南方客
南方客 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:44

    This maybe resurrecting an old thread, but was just having a similar experience. The solution that I came up with (because the thought of calling slider(...) multiple times was not appealing):

    $slider.slider('option', 'slide').call($slider, event, ui);
    

    With $slider being bound to the $(selector).slider(...) initialization.

提交回复
热议问题