追加到 jQuery 滑块句柄
有什么方法可以将 div 附加到滑块手柄,以便我可以通过拖动该 div 来控制手柄?请参阅附图。
谢谢。
Is there any way I can append a div to the slider handle, so I can control the handle by dragging that div? Please see the picture attached.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以将
连接到手柄并使用该
来控制滑块。拖动事件在手柄的子级上和在手柄本身上一样有效;因此,您可以为句柄提供一个适当的绝对定位子项,如下所示:
和一些CSS:
演示: http: //jsfiddle.net/ambiguously/9B4MC/
Yes, you can attach a
<div>
to the handle and use that<div>
to control the slider. The drag events work just as well on the handle's children as on the handle itself; so, you can just give the handle an appropriately absolutely positioned child, something like this:and some CSS:
Demo: http://jsfiddle.net/ambiguous/9B4MC/