Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不确定这是否是一个错误 - 但在此示例中,无法选择可拖动元素下方的文本。
表单元素也有同样的问题。
http://jqueryui.com/demos/draggable/handle.html
有任何想法吗?
如果您查看该页面的源代码,您会看到它调用
$("div, p").disableSelection();
... 明确禁用页面上所有divs 和ps 的选择,包括可拖动元素下方的选择。
div
p
“官方”的 jQuery 做事方式是使用 .disableSelection()。然而,在实践中,这通常毫无用处。在这种情况下,您可以使用
document.onselectstart = function () { return false; }