Making things unselectable in IE

前端 未结 4 1126
花落未央
花落未央 2020-11-30 13:07

Here is my chart I\'ve been writing in JS:

http://jsfiddle.net/49FVb/

The css:

-moz-user-select:none;
-khtml-user-select: none;
4条回答
  •  执笔经年
    2020-11-30 13:17

    This seems to work well in Chrome and IE11 so far, using JQuery...

    function fMakeNodeUnselectable(node){      
        $(node).css({"cursor":"default","-moz-user-select":"-moz-none","-khtml-user-select":"none","-webkit-user-select":"none","-o-user-select":"none","user-select":"none"});
        $(node).attr("unselectable","on");
    }   
    

提交回复
热议问题