T
T
tosha732020-05-07 12:02:15
JavaScript
tosha73, 2020-05-07 12:02:15

How to close the menu on clicking on an empty space?

Faced a problem that does not allow closing the menu when clicking on an empty space, as well as an overlap problem When

menu 1 overlaps menu 2 or vice versa

https://jsfiddle.net/msLzreda/

norms

example can be seen here - https://newcsgosettings.at.ua/

I also can't figure out why opening the menu doesn't work on small screens

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Pike, 2020-05-07
@AndyPike

document.getElementsByTagName('body')[0].onclick = () => { alert('I`m closed!')}

And then process the rest by event, through parents.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question