jquery ui selectable 与draggable 结合在 IE 中有效,但在 Firefox 中无效
我有一个设置为表格的资源树,我希望能够使用 Ctrl-Click 从树中选择多个资源以选择多个资源并将它们拖到作业表上以将资源分配给一份工作。
这一切在 IE8 中都运行良好。但是当我在 Firefox 中尝试时,选择根本不起作用,当我禁用可拖动时,可选择的工作正常,所以显然,可拖动和可选择之间的冲突仅发生在 Firefox 中。
使用 Firebug,单击表单元格之一时似乎不会触发 _mouseStart,但如果您单击表中非单元格的某些区域,则会触发 _mouseStart。
我设置了一个测试页面来演示这里的问题: www.qualitech.co.nz/测试.aspx
I have a tree of resources which is set up as a table, and I want to be able to select a number of resources from the tree using Ctrl-Click to select multiple resources and drag them over onto a table of jobs to allocate resources to a job.
This all works well in IE8. but when I try it in Firefox, selection doesn't work at all, when I disable the draggable then selectable works Ok, so its obviously a conflict between draggable and selectable that only occurs in Firefox.
Using Firebug it appears that _mouseStart is not fired when clicking on one of the table cells, but it is if you click on some area of the table which is not a cell.
I've set up a test page is to demonstrate the issue here: www.qualitech.co.nz/test.aspx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其起作用的唯一原因是 IE 中的编码错误允许位置 CSS 规则应用于 TD 元素。根据 W3C 约定,内表元素必须始终使用position: static 进行渲染。为了使可拖动元素发挥作用,可拖动元素必须能够以非静态位置从文档流中删除。这对于 TD 元件来说是不可能的。考虑切换到无序列表并使列表项变得可选择和可拖动。
The only reason this works at all is because of a coding error in IE that allows a position CSS rule to apply to TD elements. According to W3C conventions, inner table elements must always be rendered with position: static. In order for draggable to function, the draggable element must be able to be removed from document flow with a non-static position. This is not possible for TD elements. Consider switching to an unordered list and making your list items selectable and draggable.