Auto hide Sidebar

I put this code in the Page_Head

<script>
loadjs.ready("jquery",function(){
$("html").addClass("sidebar-collapse");
loadjs.ready("load",function (){
$("html").removeClass("sidebar-collapse");
})
})
</script>

But still the sidebar menu is not Auto Hide.
I am using PHPMaker 2023.12

You may use the enableRemember option to remember the sidebar status, see Push Menu Plugin, e.g.data-widget=“pushmenu” data-enable-remember=“true”

It works by putting the following code inClient Servers → Global → Pages with Header/Footer → Startup Script$(‘[data-widget=“pushmenu”]’).PushMenu(‘collapse’);But It shows the menu first and after that it close the menu.
Is there any other way to auto hide it.

You may Inspect HTML element and add your own CSS styles, see what the CSS class is when the sidebar is hidden.

thomas wrote:

But It shows the menu first and after that it close the menu.

Then you might need to write PHP code in server-side, so that the change will not be seen from client side.