How to completely DISABLE any MOUSE CLICK How to completely DISABLE any MOUSE CLICK jquery jquery

How to completely DISABLE any MOUSE CLICK


You can add a simple css3 rule in the body or in specific div, use pointer-events: none; property.


You can overlay a big, semi-transparent <div> that takes all the clicks. Just append a new <div> to <body> with this style:

.overlay {    background-color: rgba(1, 1, 1, 0.7);    bottom: 0;    left: 0;    position: fixed;    right: 0;    top: 0;}


To disable all mouse click

var event = $(document).click(function(e) {    e.stopPropagation();    e.preventDefault();    e.stopImmediatePropagation();    return false;});// disable right click$(document).bind('contextmenu', function(e) {    e.stopPropagation();    e.preventDefault();    e.stopImmediatePropagation();    return false;});

to enable it again:

$(document).unbind('click');$(document).unbind('contextmenu');