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

        $('.ms-MenuUIPopupBody').live('blur', function() {       
           var elm = $("div.ms-MenuUIULItem a:contains('View in Browser')"); 
           $("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.

| |