1
I would like to take the URL link and with it, modify the class property flechaSubmenu of display:none for display:block.
I thought I’d do with CSS:
.classe a[href^="/categoria/categoria2/"] {
display:block;
}
What happens is that the link would have to be in a div which is not the case.
In short, I want the one arrow from my site, point to the current Menu from wherever I am.
My HTML:
<li>
<a href="/pt/page/investidores">
<span>Investidores</span>
<div class="flechaSubmenu"></div>
</a>
</li>
Jquery:
$(document).ready(function(){
$("div.flechaSubMenu[href='/pt/page/investidores']").addClass("flechaI");
});
CSS:
.flechaI {display: block!important;}
I’m still not sure what you’re looking for. Do you want to add a CSS class when the URL is the same as the
href? or only to ahrefspecific that you have in a string?– Sergio
For example, when the URL is equal to /pt/page/investors to div
flechaSubMenushould staydisplay:block(or add that class I created)– Felipe Viero Goulart
have that one
<div class="flechaSubmenu"></div>in severalli, but I want it to be active according to the URL in question.– Felipe Viero Goulart
Okay, so you want to read the page url and give
class="flechaSubmenu"to the div who has the anchor with thishrefcorrect?– Sergio
Exactly, it looks like my official menu HTML that contains these
lihttp://jsfiddle.net/ps1ewtmf/– Felipe Viero Goulart
Have you seen this other question you asked before: http://answall.com/q/22206/129 ?
– Sergio
Dude, you’re looking for a simple menu with Current and it’s complicating everything.
– Lollipop
@Rafael is not what I’m complicating, is that I don’t have much knowledge at all.
– Felipe Viero Goulart