Lucas Sitterly Lucas Sitterly - 3 months ago 22
CSS Question

Remove Recycle Bin from Quick Launch SharePoint 2013

I am scratching my head on this one. I am trying to remove the Recycle Bin from my SharePoint 2013 Site (Microsoft 365). I have spent hours researching and everything I have found hasn't worked. Example 1, Example 2. The most common solution I have gotten has been adding the following to the Master Page via

CSS
:

<style>
.s4-specialNavLinkList{
display:none;
}
</style>


When I do, nothing. I have even tried viewing it from someones computer who only has view rights, as I read somewhere that those with Admin rights will always see it. I am still new to
CSS
, but have been working with it enough now that I am able to understand it better. Other manipulations I have done have worked without a hitch (hiding/removing Share/Follow from the Top Menu for example). I've even tried deleting the
s4-specialNavLinkList
in it's entirety from the script (highlighted text in image) to no avail.

Does anyone know how to properly remove this?

Answer

Finally after months of research I was able to find an answer at this site. The method is inserting the following JavaScript into a script editor web part on each page:

<script type="text/javascript" src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" target="_blank" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js</a>"></script><span id="hideMyParentsp"></span><script>$(document).ready(function() {  $('#sidebarDiv #hideMyParentsp').parent().parent().hide();      });  </script><script type="text/javascript">window.onload = function(){var x=document.getElementsByTagName("img"); for(var i=0;i<x.length;i++) { if(x[i].title=='Recycle Bin')  {   var dtag = x[i].parentNode.parentNode.parentNode; dtag.style.visibility='hidden';  } }var xx=document.getElementsByTagName("span"); for(var ii=0;ii<xx.length;ii++) {  if(xx[ii].innerHTML=='Recycle Bin')  {   xx[ii].style.display='none';  } } }; </script>
Comments