Prevent selection from Shift+Click
Possible Duplicate:
css rule to disable text selection highlighting
Prevent text selection after double click
Even though my events are properly prenting default actions, clicking in text and then Shift-clicking in other text is causing a selection. This is undesirable behaviour in this case, since I'm using Shift-click to multi-select these elements.
Is there something I need to do to specifically disable selection here?
EDIT: Found solution to my own problem here. Sorry for wasting people's time.
Add this CSS to the section where you want to prevent text-selection:
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
Earlier versions of IE require you to add the attribute onselectstart, something like this:
<div onselectstart="return false">
链接地址: http://www.djcxy.com/p/7118.html
上一篇: 我如何使HTML元素不易察觉?