本文介绍了jQuery UI Slider:具有3个手柄和可配置颜色的范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个jQuery UI滑块,它有五个不同颜色的范围,由三个手柄定义。 (所以第一个范围是句柄0 - 句柄1,第二个范围是句柄1来处理2.)这可能通过配置,还是我必须破解它?如果我需要修改源代码,是否有任何指导方针可以执行此操作?

I would like a jQuery UI slider that has five differently colored ranges defined by three handles. (So the first range would be handle 0 - handle 1, and the second range would be handle 1 to handle 2.) Is this possible through configuration, or must I hack it? If I have to modify the source, is there any guidelines for how to go about doing that?

更新:我在寻找什么在范围方面是:

Update: What I'm looking for in terms of ranges is:

| ---颜色1 ----- handle1 ---------颜色2 ------------- handle2 ------- color3 ------ --- handle3 ----- color 4 ---- |

| --- color 1 ----- handle1 --------- color 2 ------------- handle2 ------- color3 --------- handle3 -----color 4 ----|

(希望这是有道理的。)

(hopefully that makes sense.)

推荐答案

jquery ui滑块文档中定义的范围选项确实将滑块限制为仅2个句柄。当滑块引发'slide'或'change'事件并手动设置这些元素的位置时,您需要创建多个元素,这样您就可以创建一个具有多个手柄和多个范围的滑块,您可以将自定义css应用到该滑块。请参阅小提琴,了解一个工作示例。

The range option defined in the jquery ui slider documentation does indeed limit the slider to only 2 handles. You need to create several elements when the slider raises the 'slide' or 'change' event and set the position of these manually, this way you can create a slider with multiple handles and multiple ranges which you can apply custom css to. See fiddle for a working example.

这篇关于jQuery UI Slider:具有3个手柄和可配置颜色的范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 14:55