0

I am trying to hide the SharePoint 2010 context menu. I wrote the following code:

  $(document).ready(function(){      
        $('.ms-MenuUIPopupBody').live('blur', function() {       
           var elm = $("div.ms-MenuUIULItem a:contains('View in Browser')"); 
           elm.remove();     
           $("div.ms-MenuUIULItem a:contains('Edit in Browser')").remove();  
         });
  });

It is hiding menu only on focus or blur or mouse-over on the context menu.

I need to hide the menu whenever I open the context menu.

| |