Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

205
Visualizações
Add class if (hidden) anchor is

I'm writing a function to add a class to different menu items on several conditions. The first condition is already working great but now I have something different.

I have a page with some tabs #tab1,#tab2 and #tab3. However the anchor is invisible in the URL even if I switch between the tabs.

My current function:

jQuery(document).ready(function($) {
    if(window.location.pathname.indexOf("/konto/adressen/") !==-1) {
        $(".jet-custom-nav__item-6068").addClass("current-menu-item");
    }
    else if(window.location.hash == "tab1") {
        $(".jet-custom-nav__item-9886").addClass("current-menu-item");
    }
});

The default tab page refresh is #tab1. After refresh the class is added to the right menu item but somehow my code makes the URL anchor visible and if I switch to another tab it stays still active. I would appreciate any help with this not too many experience by now!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda