2
I have that list:
<li>
<a href="" class="category-subtree-expandable">Vestuário</a>
<ul>
<li>
<a href="" class="category-subtree-expandable">Feminino</a>
<ul>
<li>
<a href="/boa-forma/zumba-fitness/vestuario/feminino/blusas/camisetas" title="Camisetas">Camisetas</a>
</li>
<li>
<a href="" title="Masculino">Masculino</a>
</li>
<li>
<a href="" title="Regatas">Regatas</a>
</li>
<li>
<a href="" title="Tops">Tops</a>
</li>
<li>
<a href="" title="Capri">Capri</a>
</li>
<li>
<a href="" title="Legging">Legging</a>
</li>
</ul>
</li>
<li>
<a href="">Masculino</a>
</li>
<li>
<a href="">Unissex</a>
</li>
</ul>
</li>
And I have this script:
if ($submenu) {
[].forEach.call($submenu.querySelectorAll('.category-subtree-expandable'), function ($el) {
$el.href = '#';
$el.addEventListener('click', function (event) {
event.preventDefault();
this.nextElementSibling.classList.toggle('active');
this.classList.toggle('active');
});
});
}
When I’m on a page of some subcategory, the precise subcategory is highlighted, for example: changes color to subcategory
When you click Regattas, for example, will open another page and the code will be reviewed again, correct?
– brazilianldsjaguar
Correct @brazilianldsjaguar.
– Marcos