jQuery UI Slider (setting programmatically)

前端 未结 12 1473
借酒劲吻你
借酒劲吻你 2020-12-02 15:04

I\'d like to modify the sliders on-the-fly. I tried to do so by using

$(\"#slider\").slider(\"option\", \"values\", [50,80]);

This call wil

12条回答
  •  借酒劲吻你
    2020-12-02 15:50

    None of the above answers worked for me, perhaps they were based on an older version of the framework?

    All I needed to do was set the value of the underlying control, then call the refresh method, as below:

    $("#slider").val(50);
    $("#slider").slider("refresh");
    

提交回复
热议问题