K
K
Kalwin UA2015-08-13 11:37:21
JavaScript
Kalwin UA, 2015-08-13 11:37:21

What to do with the menu?

Hello, I have a problem. There is a menu on the main page (collapsed/expanded). It is displayed normally, but when you switch to another page, it should be expanded, but it is collapsed, shoveled all the JS, tried a bunch of methods, and did not help. I'm really at a loss. Please help me solve this problem. Here is the code.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2015-08-20
@Mari-art

Firstly, you have a binding to get-parameters in the url, it does not work in principle on the fiddle.
Secondly, I think it would be more appropriate to store some id of the open menu item, and not the html code of this item (which, when changing styles on the fly, makes this method even less accurate).
Thirdly, the problem is that you assign the open class to the last open menu item in the hierarchy, but do not assign this class to all parent menus.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question