Streaming live at 10am (PST)

Disable scroll on menu open, code not working?

I’m using the code here:

Webflow.push(function() {
$('.MenuOpen_Button').click(function(e) {
	$('body').css('overflow', 'hidden');

  $('.MenuClose_Button').click(function(e) {
	$('body').css('overflow', 'auto');

Published site:

Can’t really figure out why it’s not working to be honest. Any help will be greatly appreciated!

Class names are case-sensitive. Inspect your published site code.

@samliew in the published site code, the class name appears as “menuopen_button w-inline-block” I’ve changed them in the code to reference that and I’m still not getting anywhere with it?

menuopen_button w-inline-block is two different classes. pick one.

I’ve got menuopen_button w-inline-block and menuclose_button w-inline-block can’t see the other class?

I meant to say, use either menuopen_button OR w-inline-block, but not both together like this $('.menuopen_button w-inline-block'), as that is not a valid jQuery selector.

Cracked it, cheers mate!