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;}
            }

评论

暂无评论