I want to disable scroll once someone clicks on the Drawer Menu. Please help!

I want to disable scroll once someone clicks on the Drawer Menu. Please help!

nishant0037
Visitor
1 0 0

nishant0037_0-1722583780164.png

 

As you can see, once the drawer menu is selected, only a certain section of the page gets covered with a transparent black background. Is there a way i can extend the menu and the black transparent background to the bottom of the screen? If that is not possible, is there a way i can disable scroll when someone clicks on the drawer menu, and the black transparent background covers the entire screen?

Replies 2 (2)

GTLOfficial
Shopify Partner
444 89 87

Hello @nishant0037 
Please provide the URL and password of your website.

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: info@gtlofficial.com - Skype: ritesh_27dh

Small_Task_Help
Shopify Partner
758 24 66

Hi,

 

Need Adjust CSS for the Overlay and update HTML structure (It will be great if you share your store URL)

 

CSS example

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Black with 50% opacity */
  z-index: 999; /* Ensure it’s above other content */
  overflow: hidden; /* Prevent scroll */
}

.drawer-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px; /* Adjust width as needed */
  height: 100%; /* Full height */
  background: #fff; /* Background color of the drawer */
  z-index: 1000; /* Ensure it’s above the overlay */
  /* Add other styling as needed */
}

HTML Structure Example

<div class="drawer-overlay"></div>
<div class="drawer-menu">
  <!-- Drawer menu content -->
</div>

 

 

 

To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad