Forum Discussion
tomcowling
Jul 10, 2020Copper Contributor
Turning off Shy Menu in SharePoint modern
Hi, I currently have a site set up and I'm using the hub feature to keep a consistant menu across the site. One of our users asked me why the menu keeps disappearing and I noticed that when you s...
elkolorado
Mar 14, 2024Copper Contributor
Avail, here is ur 2024 code... to disable the header, and the flickering.
<script>
// disable flickering after hiding the header & shy header
window['__shyConductor']._totalHeightDifference = 0;
</script>
<style>
#spSiteHeader /* disable shy & page header bar */ {
display: none !important;
}
/* optional cleanup */
#sp-appBar, /* disable left nav bar */
#spCommandBar, /* disable command bar */
[data-automation-id=pageHeader] /* disable title bar */
{
display: none !important;
}
</style>
The _shyConductor is object that contains all functions for the shy header inside Microsoft Sharepoint Page. By setting heightDifference to 0, we are just quickly ignoring any change to update the scrollTop. You could use any other function of shyHeader instance to disable that as well, but I found this the simplest trick in the book.
Helped? Follow me on https://github.com/elkolorado
- Petr5Sep 13, 2024Copper Contributor
Thank you so much elkolorado! I've spend hours trying to disable the flickering and here you are serving the solution on a silver platter