How to make menu not closed?


Hi all! How to make menu not closed with JavaScript if you click on him out in the open?
I tried e.the stoppropagation() , but the menu open still closes if you click on it.
And need to menu open close only when clicking on the x or clicking on the area, not related to #innerMenu

Kindly pliz without changing the HTML
Thank you!
April 4th 20 at 00:54
2 answers
April 4th 20 at 00:56
Solution
now closes if you press the internal menu button) - spencer_Mann0 commented on April 4th 20 at 00:59
@spencer_Mann0, https://jsfiddle.net/2hyks7gr/1/
The method element.closest()
And in response to the corrected link to new example - Rubie_Farrell commented on April 4th 20 at 01:02
@Rubie_Farrell, any idea how to do without the e.the stoppropagation(); ? - spencer_Mann0 commented on April 4th 20 at 01:05
@spencer_Mann0, so https://jsfiddle.net/2tp43sej/ - Rubie_Farrell commented on April 4th 20 at 01:08
April 4th 20 at 00:58
Solution
Your crutch remove my inserts
innerMenu.onclick = e => {
e.the stoppropagation();
}

x.onclick = e => {
e.the stoppropagation();
 innerMenu.hidden = !innerMenu.hidden;
}

document.body.onclick = () => {
if(!innerMenu.hidden)
 innerMenu.hidden = true;
}
any idea how to do without the e.the stoppropagation(); ? - spencer_Mann0 commented on April 4th 20 at 01:01
What you do e.the stoppropagation() is not pleased?
You asked how to do, I wrote to you. Want the crutches to fence you in the first response the person tells how to do it. - Anabelle.Dibbert commented on April 4th 20 at 01:04
@Anabelle.Dibbert, e.the stoppropagation() will block hung counters
I'm studying different solutions to different people - spencer_Mann0 commented on April 4th 20 at 01:07
Not clear about what the counters are and how the stoppropagation they can block? Give an example - Anabelle.Dibbert commented on April 4th 20 at 01:10
@Anabelle.Dibbert, I have reached this point. But others always write about it. This should be a separate question to create and Google. Would know for example of course would answer. - spencer_Mann0 commented on April 4th 20 at 01:13
You must be confusing with stopImmediatePropagation? - Anabelle.Dibbert commented on April 4th 20 at 01:16
@Anabelle.Dibbert, about stopImmediatePropagation too.
But in this Chapter and the next are always talking about it
5e1500ea53e6a934697360.png
So I try to avoid. ))) - spencer_Mann0 commented on April 4th 20 at 01:19
The idea is clear. Well to solve to you, I can only say that I have never met with such a problem to someone did not work the collection of statistics and tracking purposes - Anabelle.Dibbert commented on April 4th 20 at 01:22
@Anabelle.Dibbert, thank you) I still would've accepted the answer. Just waiting maybe someone else will throw up solutions and ideas) - spencer_Mann0 commented on April 4th 20 at 01:25

Find more questions by tags JavaScript