问题
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