禁止文本选中
如果在做拖拽效果的时候,就会使用禁用文本被选中的功能了。
对于高版本的浏览器可以用样式来控制
-webkit-touch-callout:none; -moz-user-select: none; /*火狐*/ -webkit-user-select: none; /*webkit浏览器*/ -ms-user-select: none; /*IE10*/ -khtml-user-select: none; /*早期浏览器*/ user-select: none;
对于低版本IE6-9只能用JS 来控制
$('#ifr1 .tit')[0].onselectstart = $('#ifr1 .tit')[0].ondrag = function(){ //兼容IE6-9 禁止选择文本 return false; }