Trigger a jQuery UI slider event

前端 未结 12 2107
南方客
南方客 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've hit this problem recently, and used Felipe Castro's comment-solution, with a necessary change to set the context right:

    $slider.slider('option', 'slide').apply($slider, [null, {value: $slider.slider('value')}])
    

提交回复
热议问题