如何使 jQuery 滑块仅在拖动处理程序时滑动?

发布于 2024-09-14 12:54:38 字数 203 浏览 2 评论 0原文

我正在尝试使用多个处理程序幻灯片(如 jQuery 示例),但我希望能够在处理程序之间拖动部分。

jQuery 示例: http://jqueryui.com/demos/slider/range.html

I'm trying to use a multiple handlers slide like jQuery example, but I what to be able to drag the part between the handlers.

jQuery example:
http://jqueryui.com/demos/slider/range.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

输什么也不输骨气 2024-09-21 12:54:40

这是 原型,由 davidpadbury

如果您想手动执行此操作,请将自定义处理程序注册到 slide 事件 并通过如下方式访问处理程序来设置它们的值:

$('#slide-id').slider('value', index);

检查 范围滑块示例的源代码,这可以类似于该示例中美元值的设置来实现。但是,只有当您想要永久固定范围(即失去处理程序调整范围的能力)时,这才容易起作用。如果您想保留该功能,请检查 David Padbury 的实现。

This has been prototyped by davidpadbury.

If you want to do it manually, register a custom handler to the slide event and set the value of the handlers by accessing them like this:

$('#slide-id').slider('value', index);

Check the source of the range slider example, this can be implemented similar to the setting of the dollar values in that example. However, this will only work easily if you want to have a permanently fixed range (i.e. losing the ability to adjust the range by the handlers). If you want to preserve that feature, check the implementation by David Padbury.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文