Monday, December 28, 2015

Hide New and Edit button on Ribbon using JQuery.

Put below CSS file on content editor web part of your page.

<style type="text/css">
#Ribbon\.ListItem\.Manage\.EditProperties-Large
{
   display:none;
}


#Ribbon\.ListItem\.New\.NewListItem-Large
{
  display:none;
}


</style>

Ribbon\.ListItem\.Manage\.EditProperties-Large is the ID of Edit control on Ribbon. Similarly, You can get ID of View and New button as well using Developer tools.

Note: back slash (\) before dot (.) before each class names. Without putting back slash, you wont get the result.

1 comment: