JQuery基础

1、禁用浏览器右键菜单

function noright(obj) {
if (obj) {
obj.oncontextmenu = function () {
return false;
}
obj.ondragstart = function () {
return false;
}
obj.onselectstart = function () {
return false;
}
obj.onselect = function () {
obj.selection.empty();
}
obj.oncopy = function () {
obj.selection.empty();
}
obj.onbeforecopy = function () {
return false;
}
}
};

 

$(function(){noright(document.body);});

posted @ 2013-05-31 17:07  wfpanskxin  阅读(164)  评论(0编辑  收藏  举报