Hide the Vertical menu and icon when there is no menu item

Most the Menu Item I keep at the Navbar Item and it show in the horizontal menu.

But for some UserLevel all the menu item are at Navbar and the vertical menu is empty.
so for them I would like to hide or disabled the vertical menu with the menu icon when there is empty item for the vertical menu.

when the browser size is reduce the horizontal menu automatically change to vertical menu at that time it should show the vertical menu.

Just inspect the element id/class selector of the sidebar, and hide it by using jQuery code in Startup Script section.

mobhar wrote:

Just inspect the element id/class selector of the sidebar, and hide it by
using jQuery code in Startup Script section.

I try with

if ( !$( “.navbar-nav” ).hasClass( “.ew-navbar-item” ) ) {
$(“#ew-navbar”).hide();
}

but it hide in both the condition when there is menu item and when there is empty.

Did you hide the menu items by using server event or client scripts?

mobhar wrote:

Did you hide the menu items by using server event or client scripts?

I use it in the Client Scripts

Your jQuery code above is not for hiding menu items, but it will the navbar.

What I meant is, when you hide the menu items (not navbar or sidebar), did you use PHP code in server events?

mobhar wrote:

Your jQuery code above is not for hiding menu items, but it will the navbar.

What I meant is, when you hide the menu items (not navbar or sidebar), did you use
PHP code in server events?

Before I was trying on the client script
$(“#ew-navbar”).hide();

but unable to solve the issue
I have not use any code in server event