开发者

jQuery draggable text selection bug

开发者 https://www.devze.com 2022-12-10 02:24 出处:网络
I am not sure if this is a bug - but in this example there is no way to select the text underneath the elements that can be dragged.

I am not sure if this is a bug - but in this example there is no way to select the text underneath the elements that can be dragged.

Same issue with form elements.

http://jqueryui.com/demos/draggable/handle.html

开发者_运维百科

Any ideas?


If you look at the source code for that page, you'll see that it calls

$("div, p").disableSelection();

... which explicitly disables selection on all divs and ps on the page, including those beneath the draggable elements.


The "official" jQuery way of doing things is to use .disableSelection(). However, often times in practice, that does absolutely nothing. In this case you can bolt down all text on the page with

document.onselectstart = function () { return false; }
0

精彩评论

暂无评论...
验证码 换一张
取 消