I'm learning jQuery, and I can't seem to make this work.
I have a hamburguer button toggler, which when clicked, it should open a menu panel. At the same time, it should call a function to prevent scroll of the document.
I have 2 functions, one to disable the document scroll, other to enable it back:
function disableScroll(){...}
function enableScroll(){...}
And here I have the toggler icon click event:
$("#main-nav-toggler").click(function() {
$("#main-nav-menu").toggleClass("menu-show");
disableScroll();
});
The problem is, I don't know how to toggle between the 2 scroll functions within the toggler click event. I only know how to call one function, I don't know how to toggle between the 2 on click.