Dragging a div with jQuery causes page to be highlighted

こ雲淡風輕ζ 提交于 2019-12-10 23:57:36

问题


Please refer to my prior question here about implementing drag/drop. I got everything working fine, but now when I drag one of the list items, it also highlights practically everything on the page. With the answer from this prior question, how do I make it so it does not highlight anything while dragging? My actual code is 3 different files and is far different (much more) than the sample in the accepted answer, so I will post it only if necessary.

This is using jQuery's capabilities via draggable and droppable elements. This functionality is implemented like so (things renamed and shortened):

    $(function () {
        InitMySystem();
        $("#MyList li").draggable({ revert: true });
        $("#MyDropBox").droppable({
            drop: function (event, ui) {
                HandleDrop(selIndex, 0);
            }
        });
    });

回答1:


Have you looked at CSS user-select? It's not standard yet, but it could help you nail the issue in most browsers.



来源:https://stackoverflow.com/questions/10788517/dragging-a-div-with-jquery-causes-page-to-be-highlighted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!