How to add multiple handles to a jQuery slider on the fly

╄→гoц情女王★ 提交于 2019-12-04 04:16:34

问题


I want to do this :

  1. Add a handlle to a jQuery slider on some event
  2. That handle should have an id so that when it slides, I can access its value. Any ideas how to do this ? Here is the code in JSfiddle where a slider with two handles is implemented. All I need to do is add handles on the fly by some event triggered and get the values each handle for Further utilization.

回答1:


I don't see any possibility according to the documentation on http://jqueryui.com/demos/slider/. You could destroy and recreate the slider when a value is added or removed. This requires you to store all current values of existing handles. Not a super elegant solution but it's the only one I currently see besides updating the jquery ui library.

I updated your fiddle with a simple example: http://jsfiddle.net/FPCRb/4/



来源:https://stackoverflow.com/questions/9590929/how-to-add-multiple-handles-to-a-jquery-slider-on-the-fly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!