Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

258
Vistas
Make Navbar Active Link Background Color Remains Highlighted

I have code for side bar. I want the background of the link changes when I click it (background color automatically changes when I click either pegawai or absen). But with the javascript code like that, it always loading and the background color can't stay focused. How do I make background color for active bars?

script for the active link

code for link

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's not that simple because css can't retain the style if it's not initial style.
You need to adjust your jQuery code to check the url of the page also. You can utilize window.location.pathname And check if the current path name match with any link and add the css there.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda