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

221
Vistas
Toggle function not working on font awesome. The event handler is getting removed on id by browser after first toggle

The hamburger icon toggles to times icon but the reverse does not happen. The event handler is removed from the svg tag with the same id after first click. No other code exists in js file.

$(document).ready(function() {
  $('#menu-bar').click(function() {
    $(this).toggleClass('fa-times');
  })
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="menu-bar" class="fas fa-hamburger"></div>

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

0

The problem was with the fontawesome file all.js or all.min.js. The right files to be included when using font awesome for icons are:

<link rel="stylesheet" type="text/css" href="staticAssets/css/all.min.css">
<script type="text/javascript" src="staticAssets/js/fontawesome.min.js"></script>

Its better to include all the files downloaded for font awesome at one place, since the files also have relative paths, which might show up as errors in console.

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