Learn free online HTML5, javascript, and jquery Tutorials by Examples

Wednesday 14 January 2015

disable mouse right click in jquery

<script>
jQuery(document).ready(function(e) {
    $(document).bind("contextmenu",function(e){
        return false;
      });
});

--------------------------Another Way--------------------------

document.oncontextmenu = function() {return false;};

  $(document).mousedown(function(e){
    if( e.button == 2 ) { 
      return false;
    }
    return true;
  });

  }); 


</script>

No comments:

Post a Comment