Hi, can anyone please help.
Im trying to make dropdown menu on click with dark overlay in back when menu is open.
Up to this stage it works just fine but if I click outside of dropdown it close menu but still keep overlay active.
this is script I have so far:
$(function() {
$(“.toggle-overlay”).on(“click”, function(e) {
$(“#overlay”).toggleClass(“active”);
});
$(document).on(“click”, function(e) {
if ($(e.target).is(“.toggle-overlay”) === false) {
$(“#overlay”).removeClass(“active”);
}
});
});
Thanks!
Here is my site Read-Only: LINK
(how to share your site Read-Only link)