I am basically adding a no-scroll class to the body. Although nothing is changed and I can still scroll. I can see though that the class has actually been added to the body element. I have done the very same thing in my other project and worked great. No, I have copied that code into my new project and for some reason now it does not work. Still works on the old project though…
There isn’t much code to show but only this:
`$(document).ready(function () {
$(‘.burger-menu’).click(function () {
$(this).toggleClass(‘menu-on’);
$(‘.mobile-menu’).toggleClass(‘open’);
if ($(‘.burger-menu’).hasClass(‘menu-on’)) {
$(‘body’).addClass(‘no-scroll’);
}
else {
$(‘body’).removeClass(‘no-scroll’);
}
});
});
`
And also mobile class and burger-menu don’t have the same parent. Only have a similar great-grand-dad which is header tag. There is not much code that that.
Would be so pleased if someone can give me an idea of whats going on
Thank you