admin管理员组文章数量:1122826
My homepage is type of onepage site and I've created menu with anchor links for it, where users can navigate through sections. When user is on subpage, for example listing of posts and clicks menu item he goes back to the specific section of the homepage.
My anchors look like this:
- /
- /#about
- /#products
etc.
I'm using Bem_Menu_Walker for BEM class names.
Problem is - when I'm on the homepage all my links are set to the active state. Any ideas why and how to fix it?
Thanks.
My homepage is type of onepage site and I've created menu with anchor links for it, where users can navigate through sections. When user is on subpage, for example listing of posts and clicks menu item he goes back to the specific section of the homepage.
My anchors look like this:
- /
- /#about
- /#products
etc.
I'm using Bem_Menu_Walker for BEM class names.
Problem is - when I'm on the homepage all my links are set to the active state. Any ideas why and how to fix it?
Thanks.
Share Improve this question asked Sep 21, 2017 at 12:57 user128312user128312 11 Answer
Reset to default 0Have you tried deactivating Bem_Menu_Walker to see if that resolves the problem?
I would suggest removing the plugin and instead either adjusting your CSS or adding class names through menu management. (Each menu item allows you to add a class, if that's all you need to achieve.) Or, create your own custom walker.
Since these are all anchors, you may need to write some JavaScript that adds an event listener to your menu. When a click/tap event occurs, the JS needs to remove the active class from whatever element it is on and add the active class to the clicked/tapped element.
本文标签: Active menu item state on all menu items
版权声明:本文标题:Active menu item state on all menu items 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736287699a1927936.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论