Jump to content

Disable Scroll Bar On Hamburger Mobile

Recommended Posts

I've tried multiple different codes and I have been able to disable the scroll on mobile but not on the hamburger mobile menu. I have used this for the desktop

code injection > header 

<style>
  body {
    overflow-y: hidden;
}
</style>

 

And I have tried other code from various forums on squarespace in the custom css too; but they haven't given me the results I need. Does anyone have an answer? should I put putting header-mobile ?

Link to comment
  • Replies 5
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Can you share your website URL? What is the problem you're trying to solve by disabling overflow and scroll? Doing that can cause lots of potential issues.

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
On 11/10/2023 at 5:09 PM, Ellagrace said:

Yes no problem, Its more visual tbh rather than not having one at all, I wouldn't mind the scroll on the homepage, but we want the mobile hamburger menu to look cleaner as I think the X when you click onto the hamburger menu looks out of alignment due to the scroll bar, but I could be wrong.

https://gerbil-sepia-2p62.squarespace.com/config

BetterGas14

Try this code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script>
  $(document).ready(function() {
	$(".burger-inner").click(function() {
  $('html').addClass('html-burger-open');
});
});
</script>
<style>
  html.html-burger-open {
    overflow: hidden;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.