禁止用户选中网页上的内容,IE及Chrome下的方法一样。
$(".translate_en_ash").attr('unselectable','on').bind(
'selectstart',
function(){ return false; }
);
注:Firefox/Opera不支持onselectstart事件,所以用css方法:
.translate_en_ash{ -moz-user-select: none; }
手机端禁止选中的功能:
.translate_en_ash,.translate_en_wait{
-webkit-touch-callout:none; /*系统默认菜单被禁用*/
-webkit-user-select:none; /*webkit浏览器*/
-khtml-user-select:none; /*早期浏览器*/
-moz-user-select:none;/*火狐*/
-ms-user-select:none; /*IE10*/
user-select:none;
}
document.body.οncοntextmenu=function(){return false;};禁止用户使用鼠标右键