O
O
olezhenka2018-02-24 22:29:17
JavaScript
olezhenka, 2018-02-24 22:29:17

Why does the variable interfere first and then not?

It's just a popup list that has an active class added to it to pop up.
And for some reason, because of the callback, an error appeared due to which, on the first click, toggleClass fires 2 times and the list does not open, and in the next clicks everything normalizes and works well:
5a91ba5a11556419827993.png
The callback itself looks like this:
the header_account_is_open variable changes its boolean value depending whether the element has an active class:
5a91ba604e219892225380.png
The problem is in this header_account_is_open variable, because when I delete the callback or the variable itself and where it is used, everything starts working well:
5a91ba660335a329593041.png
toggleClass is not dependent on this variable at all and I can’t understand why happening...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
po5epT, 2018-02-24
@po5epT

Does the header_account_is_open variable change anywhere else in other handlers? For because of the emergence of the event, it is possible that something changes it further. There are no other suggestions yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question