CSS禁用鼠标拖拽选中内容
文章目录
chrome -webkit-user-select:none
firxfox -moz-user-select:none
IE需要使用JS的onSelected事件了。
JS代码
dom.style.MozUserSelect = 'none';//fixrox禁止选择的JS脚本
dom.style.webkitUserSelect = 'none';
if( document.all ){//IE下禁止选择
dom.onselectstart=function(){return false;}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论