I have this website i'm making, and i have an hidden menu, that so far works correctly, but i want that when it is visible to have the option to click on the body to make it hide.
So far i have this code, but it doesn't work, since i'm coding on codeine it gives me the error "Attempting to assign readonly property", plus, makes the entire page disappear.
Here is my code for this segment, i am using also in this website parallax.js and fullPage.js
//function hideMenu {
//var $menu_visivel = $('.menu2').is(":visible");
//if ($menu_visivel) {
//$('body').click(function() {
//});
//} else {
//};
//}
Here is the full Pen , and debug page. Much thanks in advance.