add active class to men, I actually don't know what I'm doing wrong
Hi every one.
I actually don't know what I'm doing wrong, but I want to add class active to my menu and nothing works. I've tried with razor, javascript, jqyery. here is what i have tried. What am I doing wrong and why will it not work. :D
What you have should work but are you by chance using dynamics? You'd do this in that case:
class="@(item.IsAncestorOrSelf(CurrentPage) ? "active" : null)"
ahh it does some how work, but it dont show anything, it have to make bottom line under each menu when it is active i will try to se the css maybe that will fix it :D
add active class to men, I actually don't know what I'm doing wrong
Hi every one. I actually don't know what I'm doing wrong, but I want to add class active to my menu and nothing works. I've tried with razor, javascript, jqyery. here is what i have tried. What am I doing wrong and why will it not work. :D
What you have should work but are you by chance using dynamics? You'd do this in that case: class="@(item.IsAncestorOrSelf(CurrentPage) ? "active" : null)"
no I don't think I do, how do I do it using dynamic ?. :)
Like this, but you don't want to do that: @{ var selection = @CurrentPage.AncestorOrSelf(1).Children.Where("Visible"); }
Any chance its a front end thing like the class being applied to an element you're not expecting?
not what I can see. it's a very ordinary bootstrap 4 menu, so there should be anythinh :)
What's the HTML that's being rendered?
now i got it to work on my 3 last menu bu not on the first 2. i really dont now what is wrong in my code. i use this code here to set the class active
this i my meny
ahh it does some how work, but it dont show anything, it have to make bottom line under each menu when it is active i will try to se the css maybe that will fix it :D
Have you fixed this yet
not yet, but I've made it work on the last 3 navbars, but for some reason it won't work on the first 2
is working on a reply...