I'm currently working with a jQuery code that is functioning properly.
$(window).load(function() {
$('.menuBtn').click(function(e) {
e.preventDefault();
(this.classList.contains('is-active') === true) ? this.classList.remove('is-active'): this.classList.add('is-active');
$('nav').slideToggle();
$('.headerBarm').toggleClass('fixed-position');
$('nav').toggleClass('fixed-position');
$('.headerBar').toggleClass('fixed-position');
$('body').css({
'height': '100%',
'overflow': 'hidden'
});
});
});
Lately, I made an update by adding the last line of code.
$('body').css({
'height': '100%',
'overflow': 'hidden'
});
Upon clicking the button, the CSS mentioned above gets applied.
The issue I am facing is that when I click it again, it doesn't revert back to its original state. Would implementing a toggle feature solve this problem?