how do you disable the right mouse button with jquery?
if it's for the whole document, you can do it like this
$(document).ready(function() {
$("body").contextmenu(function(){
return false;
});
});
thanks, and how do you make it so the text can't be selected and copied?
jQuery.fn.extend({
disableSelection : function() {
this.each(function() {
this.onselectstart = function() { return false; };
this.unselectable = "on";
jQuery(this).css({
'-moz-user-select': 'none'
,'-o-user-select': 'none'
,'-khtml-user-select': 'none'
,'-webkit-user-select': 'none'
,'-ms-user-select': 'none'
,'user-select': 'none'
});
// For Opera
jQuery(this).bind('mousedown', function() {
return false;
});
});
}
});
jQuery(function(){
jQuery('body').disableSelection();
});
Comments