jQuery UI 可选 - 从对象外部开始拖动选择
我正在使用 jQuery UI Slectable http://jqueryui.com/demos/selectable/
初始化后(就像该链接上的演示一样)。仅当我开始在对象顶部按住鼠标按钮时,拖动选择才有效。如果我从对象外部开始拖动选择,则选择不起作用。
有什么方法可以启用它,以便用户可以在可选择对象之外启动拖动选择?
I am using the jQuery UI Slectable http://jqueryui.com/demos/selectable/
Once initialized (just like in the demo on that link). drag-selecting only works if I start holding the mouse button on top of a object. If I start drag-selecting from outside of the objects, the selecting does not work.
Is there any way to enable it so the user can initiate the drag-selecting outside of the Selectable objects?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“selectable”中的鼠标事件侦听器绑定到您附加到的包装元素。通过将其连接到主体并提供过滤器,您可以获得您想要的东西。
基于 jQuery 示例:
*编辑:
不幸的是因为这个。_trigger("stop", event);它将停止页面上的其他事件。
您最好的解决方案可能是使可选择项周围的包装更大。*
The mouse event listener in the 'selectable' is bound to the wrapper element that you have attached it to. By attaching the it to the body and providing a filter you can get what you're looking for.
Based on the jQuery example:
*Edit:
Unfortunately because of this._trigger("stop", event); it will stop other events on the page.
Your best solution might be to just make the wrapper around the selectables larger.*
这种行为已经发生了,只是你看不到而已!
只需调整
ul.selectable
的 css,使其正确包含浮动的li
。This behaviour is already happening, you just can't see it!
Simply adjust the css for your
ul.selectable
so that it properly contains the floatedli
's.