I made this "slide-out" menu: SASS Slide-out Menu.
It's ok, but I want that when the menu have slid, on window click the menu returns back(remove the class "nav-open").
I tried this on the codepen demo, but it doesn't work:
window.on("click", function(e) {
if(wrapper.hasClass("nav-open") && e.target != nav && e.target.parent() != nav) {
wrapper.removeClass("nav-open");
}
});